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

test: change duration_ms to duration #7133

Closed
wants to merge 1 commit into from

Conversation

gibfahn
Copy link
Member

@gibfahn gibfahn commented Jun 3, 2016

Checklist
  • tests and code linting passes
  • the commit message follows commit guidelines
Affected core subsystem(s)

test

Description of change

The test script (tools/test.py) logs duration as "duration_ms: x.y" this is confusing (as the duration is measured in seconds). This PR changes duration_ms to duration. It's a small change, but the duration_ms causes a lot of confusion to people who are new to the tests.

The only other use of duration_ms in the codebase is in test/cctest/test-cpu-profiler.cc which I don't think should be affected by this change.

For background see @rvagg's comment - #2393 (comment)

@mscdex mscdex added test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory. labels Jun 3, 2016
@jasnell
Copy link
Member

jasnell commented Jun 3, 2016

LGTM

1 similar comment
@claudiorodriguez
Copy link
Contributor

LGTM

@gibfahn
Copy link
Member Author

gibfahn commented Jun 3, 2016

@jasnell I can't imagine how this could cause tests to fail, but is it worth running a test-commit on it anyway?

@jasnell
Copy link
Member

jasnell commented Jun 3, 2016

Of course :-): https://ci.nodejs.org/job/node-test-pull-request/2914/

@@ -310,7 +310,7 @@ def HasRun(self, output):
(duration.seconds + duration.days * 24 * 3600) * 10**6) / 10**6

logger.info(' ---')
logger.info(' duration_ms: %d.%d' % (total_seconds, duration.microseconds / 1000))
logger.info(' duration: %d.%d' % (total_seconds, duration.microseconds / 1000))
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be duration: %d.%ds? (where s denotes seconds)?

Copy link
Member Author

Choose a reason for hiding this comment

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

That would definitely make sense.

@gibfahn
Copy link
Member Author

gibfahn commented Jun 5, 2016

Updated as per @Fishrock123's suggestion, PTAL.

The test script (tools/test.py) logs duration as "duration_ms: x.y".
This is confusing (as the duration is measured in seconds).

New example output: duration: 0.212s
@cjihrig
Copy link
Contributor

cjihrig commented Jun 5, 2016

LGTM

1 similar comment
@mhdawson
Copy link
Member

mhdawson commented Jun 6, 2016

LGTM

jasnell pushed a commit that referenced this pull request Jun 6, 2016
The test script (tools/test.py) logs duration as "duration_ms: x.y".
This is confusing (as the duration is measured in seconds).

New example output: duration: 0.212s

PR-URL: #7133
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@jasnell
Copy link
Member

jasnell commented Jun 6, 2016

Landed in d413378

@rvagg
Copy link
Member

rvagg commented Jun 8, 2016

Reversion filed at #7214, sorry to be a party-pooper and for catching this late, but at least now it'll stick in more than just my head when it inevitably comes up in the future:

I'm pretty sure we've had this discussion at least twice on GitHub already but I can't find either record unfortunately. Sorry I'm just catching up and saw this PR only now.

"duration_ms" is a TAP thing and yes it's confusing and doesn't read well but you have to interpret it as "duration including milliseconds", so it's "seconds.milliseconds". When you change it, TAP parsers don't pick it up properly.

Compare the CI run that was done specifically for #7133 prior to merging:

screen shot 2016-06-08 at 4 38 17 pm

With the run for that same slave machine done just one before without this change:

screen shot 2016-06-08 at 4 37 44 pm

So now we've lost timing information, which is important when looking for timeouts (if you use the parsed results, I use the raw console but I know a lot of people prefer the former).

evanlucas pushed a commit that referenced this pull request Jun 15, 2016
The test script (tools/test.py) logs duration as "duration_ms: x.y".
This is confusing (as the duration is measured in seconds).

New example output: duration: 0.212s

PR-URL: #7133
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@evanlucas evanlucas mentioned this pull request Jun 16, 2016
@gibfahn gibfahn deleted the fix-duration_ms branch December 16, 2016 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants