Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve JUnit test duration precision #1460

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

uuf6429
Copy link

@uuf6429 uuf6429 commented Mar 3, 2024

Closes #1443.

CC @spolischook

@@ -83,17 +91,16 @@ private function captureAfterFeatureEvent(Event $event)
$timer = $this->featureTimerStore[$key];
if ($timer instanceof Timer) {
$timer->stop();
$this->featureResultStore[$key] = round($timer->getTime());
$this->featureResultStore[$key] = $timer->getTime();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering, why do we keep a reference to the timer (after finishing) AND store the timer result in a separate property/array?

  • If we want to free up memory, we should unset($this->featureTimerStore[$key]); after $this->featureResultStore[$key] = $timer->getTime();
  • if we don't care about memory, we should remove featureResultStore entirely and just call $timer->getTime() when needed

CC @higrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] jUnit formatter returns time as int but should use float
1 participant