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

Investigate flaky test-inspector-open on Linux #14316

Closed
Trott opened this issue Jul 17, 2017 · 3 comments · Fixed by #14320
Closed

Investigate flaky test-inspector-open on Linux #14316

Trott opened this issue Jul 17, 2017 · 3 comments · Fixed by #14320
Labels
flaky-test Issues and PRs related to the tests with unstable failures on the CI. inspector Issues and PRs related to the V8 inspector protocol

Comments

@Trott
Copy link
Member

Trott commented Jul 17, 2017

  • Version: 9.0.0-pre
  • Platform: centos7-64
  • Subsystem: test inspector

https://ci.nodejs.org/job/node-test-commit-linux/11219/nodes=centos7-64/console

not ok 769 parallel/test-inspector-open
  ---
  duration_ms: 1.394
  severity: fail
  stack: |-
    Debugger listening on ws://127.0.0.1:37636/5c4f715d-867c-4efe-bace-e5ef92703b40
    For help see https://nodejs.org/en/docs/inspector
    Debugger listening on ws://127.0.0.1:37636/af0c5509-c1c1-46d4-a332-66142717004f
    For help see https://nodejs.org/en/docs/inspector
    assert.js:48
      throw new errors.AssertionError({
      ^
    
    AssertionError [ERR_ASSERTION]: '37636' !== '37636'
        at ChildProcess.reopenAfterClose (/home/iojs/build/workspace/node-test-commit-linux/nodes/centos7-64/test/parallel/test-inspector-open.js:71:10)
        at ChildProcess.<anonymous> (/home/iojs/build/workspace/node-test-commit-linux/nodes/centos7-64/test/common/index.js:512:15)
        at Object.onceWrapper (events.js:318:30)
        at emitTwo (events.js:125:13)
        at ChildProcess.emit (events.js:213:7)
        at emit (internal/child_process.js:776:12)
        at _combinedTickCallback (internal/process/next_tick.js:141:11)
        at process._tickCallback (internal/process/next_tick.js:180:9)
@Trott Trott added flaky-test Issues and PRs related to the tests with unstable failures on the CI. inspector Issues and PRs related to the V8 inspector protocol labels Jul 17, 2017
@gibfahn
Copy link
Member

gibfahn commented Jul 17, 2017

So this assertion checks that when you close and reopen you don't get the same port. However AIUI node just picks a free port, so there is a (very small) chance you'll get the same port.

cc/ @sam-github as you wrote the original test.

@Trott
Copy link
Member Author

Trott commented Jul 17, 2017

However AIUI node just picks a free port, so there is a (very small) chance you'll get the same port.

If it's asking the operating system to supply a free port (which I imagine it is), then that really should not ever happen. AFAIK, every operating system increments to the next free port on each request for a free port.

This deterministic nature seems to be confirmed for me when I run this test and see the output showing that the two ports are apart by 4 every time. 59323 and 59327 the first run. 59329 and 59333 the next one. And so on and so forth.

At the same time, there it is above happening. So ¯\(ツ)/¯. Maybe this assertion is actually masking the real problem? (In which case, the correct course of action is probably still the same: Remove the assertion.)

@bnoordhuis
Copy link
Member

Gibson's hypothesis seems plausible enough to me. Try narrowing the ephemeral port range and see what happens (and keep in mind that the port allocation scheme is platform and kernel specific - the centos7 bot runs linux 3.10.)

gibfahn added a commit to gibfahn/node that referenced this issue Aug 12, 2017
Test checks that if you open the inspector with '0' (pick a random free
port), close it, then reopen it, you get a different port. However this
isn't necessarily true.

PR-URL: nodejs#14320
Fixes: nodejs#14316
Refs: nodejs#14316 (comment)
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
addaleax pushed a commit that referenced this issue Aug 12, 2017
Test checks that if you open the inspector with '0' (pick a random free
port), close it, then reopen it, you get a different port. However this
isn't necessarily true.

PR-URL: #14320
Fixes: #14316
Refs: #14316 (comment)
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky-test Issues and PRs related to the tests with unstable failures on the CI. inspector Issues and PRs related to the V8 inspector protocol
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants