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-debug-port-from-cmdline odd behaviour #2177

Closed
mathiask88 opened this issue Jul 14, 2015 · 4 comments
Closed

test-debug-port-from-cmdline odd behaviour #2177

mathiask88 opened this issue Jul 14, 2015 · 4 comments
Labels
test Issues and PRs related to the tests. windows Issues and PRs related to the Windows platform.

Comments

@mathiask88
Copy link
Contributor

I recently ran the parallel tests on my win8.1x64 machine and saw a strange behaviour of test-debug-port-from-cmdline. For the release build the test passed but for the debug build not. The startup time for a node process in debug build is ~2secs and the child process was closed before the parent had a chance to connect the debugger.
Is this normal that the release and debug builds show different behaviours?

Test gists:
https://gist.github.com/mathiask88/af67b5b7b60bab5ce990
https://gist.github.com/mathiask88/6e4763580649eb06fe2e

@brendanashworth brendanashworth added the test Issues and PRs related to the tests. label Jul 14, 2015
@silverwind
Copy link
Contributor

Not normal. I think it's safe to assume that there is some underlying bug here which results in intermittent test failures. We thought they were related to our CI machines, but your experience shows it happens in the wild too.

See #2094 and #2149 for some (likely misguided) attempts at fixing it.

@orangemocha another new error on this test. It translate to 'The system cannot find the given file':

not ok 136 - test-debug-port-from-cmdline.js
#C:\Users\Mathias\Documents\GitHub\io.js\test\parallel\test-debug-port-from-cmdline.js:20
#    process._debugProcess(child.pid);
#            ^
#Error: Das System kann die angegebene Datei nicht finden.
#    at Error (native)
#    at ChildProcess.onChildMsg (C:\Users\Mathias\Documents\GitHub\io.js\test\parallel\test-debug-port-from-cmdline.js:20:13)
#    at emitTwo (events.js:87:13)
#    at ChildProcess.emit (events.js:172:7)
#    at handleMessage (internal/child_process.js:632:10)
#    at Pipe.channel.onread (internal/child_process.js:421:11)

@mathiask88
Copy link
Contributor Author

@silverwind This error comes from OpenProcess in DebugProcess in node.cc because the child process is already terminated.The child process exits after stream.end() @ https://github.com/nodejs/io.js/blob/master/test/parallel/test-debug-port-from-cmdline.js#L11
Maybe it is related to #2149 but I think that one is caused by another reason.

@mscdex mscdex added debugger windows Issues and PRs related to the Windows platform. labels Jul 15, 2015
joaocgreis added a commit to JaneaSystems/node that referenced this issue Jul 15, 2015
This test was failing because the spawned process was terminated before
anything could be done, by calling child.stdin.end. With this change,
the child's stdin is no longer closed. When the stdin is not a tty,
io.js waits for the whole input before starting, so the child must be
run with --interactive to process the command sent by the parent. The
child is killed explicitly by the parent before it exits.

This test was failing silently because the asserts were not called if
nothing was received from the child. This fix moves assertOutputLines to
always run on exit.

Fixes nodejs#2094
Fixes nodejs#2177
@joaocgreis
Copy link
Member

@mathiask88 I had the same problem, the debug build failed every time, exactly as yours. I investigated and found it is the same problem as #2149 . I opened a PR: #2186 . If you have the time, can you check if it fixes your issue?

cjihrig pushed a commit that referenced this issue Jul 16, 2015
This test was failing because the spawned process was terminated before
anything could be done, by calling child.stdin.end. With this change,
the child's stdin is no longer closed. When the stdin is not a tty,
io.js waits for the whole input before starting, so the child must be
run with --interactive to process the command sent by the parent. The
child is killed explicitly by the parent before it exits.

This test was failing silently because the asserts were not called if
nothing was received from the child. This fix moves assertOutputLines to
always run on exit.

Fixes: #2177
Refs: #2094
PR-URL: #2186
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Alexis Campailla <alexis@janeasystems.com>
@cjihrig
Copy link
Contributor

cjihrig commented Jul 16, 2015

Fixed in 2b4b600

@cjihrig cjihrig closed this as completed Jul 16, 2015
joaocgreis added a commit to nodejs/node-v0.x-archive that referenced this issue Jul 23, 2015
This change is a backport of 2b4b600
from io.js.

Original commit message:

  This test was failing because the spawned process was terminated
  before anything could be done, by calling child.stdin.end. With this
  change, the child's stdin is no longer closed. When the stdin is not
  a tty, io.js waits for the whole input before starting, so the child
  must be run with --interactive to process the command sent by the
  parent. The child is killed explicitly by the parent before it exits.

  This test was failing silently because the asserts were not called if
  nothing was received from the child. This fix moves assertOutputLines
  to always run on exit.

  Fixes: nodejs/node#2177
  Refs: nodejs/node#2094
  PR-URL: nodejs/node#2186
  Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  Reviewed-By: Rod Vagg <rod@vagg.org>
  Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
  Reviewed-By: Alexis Campailla <alexis@janeasystems.com>

Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #25748
jBarz pushed a commit to ibmruntimes/node that referenced this issue Nov 4, 2016
This change is a backport of 2b4b600
from io.js.

Original commit message:

  This test was failing because the spawned process was terminated
  before anything could be done, by calling child.stdin.end. With this
  change, the child's stdin is no longer closed. When the stdin is not
  a tty, io.js waits for the whole input before starting, so the child
  must be run with --interactive to process the command sent by the
  parent. The child is killed explicitly by the parent before it exits.

  This test was failing silently because the asserts were not called if
  nothing was received from the child. This fix moves assertOutputLines
  to always run on exit.

  Fixes: nodejs/node#2177
  Refs: nodejs/node#2094
  PR-URL: nodejs/node#2186
  Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  Reviewed-By: Rod Vagg <rod@vagg.org>
  Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
  Reviewed-By: Alexis Campailla <alexis@janeasystems.com>

Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs#25748
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. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants