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

benchmark: allow no duration in benchmark tests #13110

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
7 participants
@Trott
Member

Trott commented May 18, 2017

Imprecision in process.hrtime() in some situations can result in a zero
duration being used as a denominator in benchmark tests. This would
almost certainly never happen in real benchmarks. It is only likely in
very short benchmarks like the type we run in our test suite to just
make sure that the benchmark code is runnable.

So, if the environment variable that we use in tests to indicate "allow
ludicrously short benchmarks" is set, convert a zero duration for
a benchmark to 1 nano-second.

Fixes: #13102

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test benchmark http

@refack

refack approved these changes May 18, 2017

Makes sense

@mscdex

This comment has been minimized.

Show comment
Hide comment
@mscdex

mscdex May 19, 2017

Contributor

I think this should probably be prefixed with benchmark: instead.

Contributor

mscdex commented May 19, 2017

I think this should probably be prefixed with benchmark: instead.

@mscdex mscdex removed http test labels May 19, 2017

benchmark: allow no duration in benchmark tests
Imprecision in process.hrtime() in some situations can result in a zero
duration being used as a denominator in benchmark tests. This would
almost certainly never happen in real benchmarks. It is only likely in
very short benchmarks like the type we run in our test suite to just
make sure that the benchmark code is runnable.

So, if the environment variable that we use in tests to indicate "allow
ludicrously short benchmarks" is set, convert a zero duration for
a benchmark to 1 nano-second.

Fixes: #13102

@Trott Trott changed the title from test: allow no duration in benchmark tests to benchmark: allow no duration in benchmark tests May 19, 2017

@Trott

This comment has been minimized.

Show comment
Hide comment
@Trott

Trott May 19, 2017

Member

I think this should probably be prefixed with benchmark: instead.

@mscdex Sure thing. Updated the PR title and the first line of the commit message as requested.

Member

Trott commented May 19, 2017

I think this should probably be prefixed with benchmark: instead.

@mscdex Sure thing. Updated the PR title and the first line of the commit message as requested.

@Trott

This comment has been minimized.

Show comment
Hide comment

Trott added a commit to Trott/io.js that referenced this pull request May 22, 2017

benchmark: allow no duration in benchmark tests
Imprecision in process.hrtime() in some situations can result in a zero
duration being used as a denominator in benchmark tests. This would
almost certainly never happen in real benchmarks. It is only likely in
very short benchmarks like the type we run in our test suite to just
make sure that the benchmark code is runnable.

So, if the environment variable that we use in tests to indicate "allow
ludicrously short benchmarks" is set, convert a zero duration for
a benchmark to 1 nano-second.

PR-URL: nodejs#13110
Fixes: nodejs#13102
Fixes: nodejs#12433
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@Trott

This comment has been minimized.

Show comment
Hide comment
@Trott

Trott May 22, 2017

Member

Landed in c3067b5

Member

Trott commented May 22, 2017

Landed in c3067b5

@Trott Trott closed this May 22, 2017

jasnell added a commit that referenced this pull request May 23, 2017

benchmark: allow no duration in benchmark tests
Imprecision in process.hrtime() in some situations can result in a zero
duration being used as a denominator in benchmark tests. This would
almost certainly never happen in real benchmarks. It is only likely in
very short benchmarks like the type we run in our test suite to just
make sure that the benchmark code is runnable.

So, if the environment variable that we use in tests to indicate "allow
ludicrously short benchmarks" is set, convert a zero duration for
a benchmark to 1 nano-second.

PR-URL: #13110
Fixes: #13102
Fixes: #12433
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>

jasnell added a commit that referenced this pull request May 23, 2017

benchmark: allow no duration in benchmark tests
Imprecision in process.hrtime() in some situations can result in a zero
duration being used as a denominator in benchmark tests. This would
almost certainly never happen in real benchmarks. It is only likely in
very short benchmarks like the type we run in our test suite to just
make sure that the benchmark code is runnable.

So, if the environment variable that we use in tests to indicate "allow
ludicrously short benchmarks" is set, convert a zero duration for
a benchmark to 1 nano-second.

PR-URL: #13110
Fixes: #13102
Fixes: #12433
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>

@jasnell jasnell referenced this pull request May 28, 2017

Closed

8.0.0 Release Proposal #12220

@gibfahn gibfahn referenced this pull request Jun 15, 2017

Closed

Auditing for 6.11.1 #230

2 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment