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

sequential/test-debug-host-port hanging when the port is not available #11536

Closed
gdams opened this issue Feb 24, 2017 · 7 comments
Closed

sequential/test-debug-host-port hanging when the port is not available #11536

gdams opened this issue Feb 24, 2017 · 7 comments
Assignees
Labels
test Issues and PRs related to the tests.

Comments

@gdams
Copy link
Member

gdams commented Feb 24, 2017

We are getting an error when running this test in that if the port is in use, the test will just hang and never fail. I see two issues here:

  1. It would be good if the test could use a random port.
  2. test.py should abort the test after 60s.
@mscdex mscdex added debugger test Issues and PRs related to the tests. labels Feb 24, 2017
@santigimeno
Copy link
Member

santigimeno commented Feb 24, 2017

Doing something like this fixes the issue for me:

diff --git a/test/sequential/test-debug-host-port.js b/test/sequential/test-debug-host-port.js
index 88ce7bc..964774f 100644
--- a/test/sequential/test-debug-host-port.js
+++ b/test/sequential/test-debug-host-port.js
@@ -14,7 +14,8 @@ function test(args, needle) {
     proc.stderr.setEncoding('utf8');
     proc.stderr.on('data', (data) => {
       stderr += data;
-      if (stderr.includes(needle)) proc.kill();
+      if (stderr.includes(needle) || stderr.includes('Error:'))
+        proc.kill();
     });
     proc.on('exit', common.mustCall(() => {
       assert(stderr.includes(needle));

What I don't know if it's correct behavior that calling ./node --debug-brk when the 5858 port is in use does not make the process to exit. It just prints the ADDRINUSE error trace.

@bnoordhuis
Copy link
Member

bnoordhuis commented Feb 24, 2017

What I don't know if it's correct behavior that calling ./node --debug-brk when the 5858 port is in use does not make the process to exit.

Yes and no, see https://github.com/nodejs/node/blob/v7.6.0/lib/internal/bootstrap_node.js#L404-L418. It's intentional but it's a hack.

EDIT: Also https://github.com/nodejs/node/blob/v7.6.0/lib/module.js#L549-L565

@gibfahn
Copy link
Member

gibfahn commented Jul 12, 2017

@bnoordhuis are you okay with @santigimeno's proposed fix? If so @santigimeno would you mind PRing?

@bnoordhuis
Copy link
Member

test/sequential/test-debug-host-port.js was removed in #12197 so this is no longer an issue. I'll close it out.

@gibfahn
Copy link
Member

gibfahn commented Jul 13, 2017

@bnoordhuis sure, but this is failing for us on v6.x (and v4.x, but there's not much we can do about it at this point).

@bnoordhuis
Copy link
Member

Oh, right. Then PR'ing against v6 is a good idea.

@bnoordhuis bnoordhuis reopened this Jul 13, 2017
@gibfahn gibfahn self-assigned this Jul 14, 2017
@Trott Trott added the v6.x label Jul 7, 2018
@apapirovski
Copy link
Member

There is almost no time left for supporting v6.x so I'm just going to close this out. If someone wants to re-open this, perhaps consider following up with a way to progress this.

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.
Projects
None yet
Development

No branches or pull requests

7 participants