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: fix flaky test-benchmark-util #17473

Closed
wants to merge 1 commit into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Dec 5, 2017

Allow for zero iterations on benchmarks with a short duration.

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

test benchmark util

Allow for zero iterations on benchmarks with a short duration.
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Dec 5, 2017
@Trott Trott added benchmark Issues and PRs related to the benchmark subsystem. util Issues and PRs related to the built-in util module. labels Dec 5, 2017
@Trott
Copy link
Member Author

Trott commented Dec 5, 2017

Example failure without this change:

https://ci.nodejs.org/job/node-test-commit-linux/14693/nodes=alpine36-container-x64/consoleFull

not ok 157 parallel/test-benchmark-util
  ---
  duration_ms: 4.604
  severity: fail
  stack: |-
    
    util/format.js
    util/format.js type="" n=1: 2,443.7927663734113
    
    util/inspect-array.js
    util/inspect-array.js type="" len=100000 n=1: 13.369450815581954
    
    util/inspect-proxy.js
    util/inspect-proxy.js n=1: 493.1190172335234
    
    util/inspect.js
    util/inspect.js option="none" method="Array" n=1: 44.57330487832981
    
    util/normalize-encoding.js
    /home/iojs/build/workspace/node-test-commit-linux/nodes/alpine36-container-x64/benchmark/common.js:202
          throw new Error('insufficient clock precision for short benchmark');
          ^
    
    Error: insufficient clock precision for short benchmark
        at Benchmark.end (/home/iojs/build/workspace/node-test-commit-linux/nodes/alpine36-container-x64/benchmark/common.js:202:13)
        at main (/home/iojs/build/workspace/node-test-commit-linux/nodes/alpine36-container-x64/benchmark/util/normalize-encoding.js:63:9)
        at Benchmark.process.nextTick (/home/iojs/build/workspace/node-test-commit-linux/nodes/alpine36-container-x64/benchmark/common.js:34:28)
        at process._tickCallback (internal/process/next_tick.js:155:11)
        at Function.Module.runMain (module.js:703:11)
        at startup (bootstrap_node.js:195:16)
        at bootstrap_node.js:646:3
    assert.js:42
      throw new errors.AssertionError({
      ^
    
    AssertionError [ERR_ASSERTION]: 1 strictEqual 0
        at ChildProcess.child.on (/home/iojs/build/workspace/node-test-commit-linux/nodes/alpine36-container-x64/test/common/benchmark.js:25:12)
        at ChildProcess.emit (events.js:126:13)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)

@Trott
Copy link
Member Author

Trott commented Dec 5, 2017

Copy link
Contributor

@evanlucas evanlucas left a comment

Choose a reason for hiding this comment

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

LGTM if CI is happy

@Trott
Copy link
Member Author

Trott commented Dec 5, 2017

plinux failure on CI has to be unrelated but just in case: https://ci.nodejs.org/job/node-test-commit-plinux/13703/

Same for LinuxOne: https://ci.nodejs.org/job/node-test-commit-linuxone/10887/

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

@Trott
Copy link
Member Author

Trott commented Dec 5, 2017

(CI is good.)

@Trott
Copy link
Member Author

Trott commented Dec 7, 2017

Landed in 6c0c60c

@Trott Trott closed this Dec 7, 2017
Trott added a commit to Trott/io.js that referenced this pull request Dec 7, 2017
Allow for zero iterations on benchmarks with a short duration.

PR-URL: nodejs#17473
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
Allow for zero iterations on benchmarks with a short duration.

PR-URL: #17473
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
Allow for zero iterations on benchmarks with a short duration.

PR-URL: #17473
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Dec 12, 2017
@Trott Trott deleted the fix-bench-util-test branch January 13, 2022 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmark Issues and PRs related to the benchmark subsystem. test Issues and PRs related to the tests. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants