Repository navigation
Investigate flaky parallel/test-debug-port-numbers #7034
Copy link
Copy link
Closed
Labels
testIssues and PRs related to Node.js core tests and test infrastructure.Issues and PRs related to Node.js core tests and test infrastructure.
Description
This appears to be the (or one) cause of the recent firestorm of EADDRINUSE failures on CI. (@jbergstroem reported that the test was running and not exiting on CI hosts exhibiting the EADDRINUSE issue.)
Ran a stress test to confirm, and sure enough...
https://ci.nodejs.org/job/node-stress-single-test/nodes=freebsd102-64/748/console
+ OK=5
+ echo '5 OK: 5 NOT OK: 0 TOTAL: 999'
5 OK: 5 NOT OK: 0 TOTAL: 999
+ for i in '`seq $RUN_TIMES`'
+ python tools/test.py -p tap --mode=release parallel/test-debug-port-numbers
1..1
ok 1 parallel/test-debug-port-numbers
---
duration_ms: 1.376
...
+ OK=6
+ echo '6 OK: 6 NOT OK: 0 TOTAL: 999'
6 OK: 6 NOT OK: 0 TOTAL: 999
+ for i in '`seq $RUN_TIMES`'
+ python tools/test.py -p tap --mode=release parallel/test-debug-port-numbers
1..1
not ok 1 parallel/test-debug-port-numbers
# TIMEOUT
# debug> debug> debug> debug> �< Debugger listening on port 12346�< Debugger listening on port 12347
# debug> �connecting to 127.0.0.1:12347 ...
# ��debug> < Debugger listening on port 12348< Error: listen EADDRINUSE :::12349�connecting to 127.0.0.1:12346 ...
# debug> �connecting to 127.0.0.1:12348 ..
# debug> �connecting to 127.0.0.1:12349 .... ok
# debug> ok
# debug> ok
# debug> �< at Object.exports._errnoException (util.js:1007:11)
# < at exports._exceptionWithHostPort (util.js:1030:20)
# < at Agent.Server._listen2 (net.js:1253:14)
# < at listen (net.js:1289:10)
# < at Agent.Server.listen (net.js:1385:5)
# < at Object.start (_debug_agent.js:21:9)
# < at startup (node.js:74:44)
# < at node.js:444:3
# debug> ok
# debug> �break in test/parallel/test-debug-port-numbers.js:1
# �> 1 'use strict';
# � 2
# � 3 const common = require('../common');
# debug> �break in test/parallel/test-debug-port-numbers.js:1
# �> 1 'use strict';
# � 2
# � 3 const common = require('../common');
# debug> �break in test/parallel/test-debug-port-numbers.js:1
# �> 1 'use strict';
# � 2
# � 3 const common = require('../common');
# debug>
---
duration_ms: 60.65
...
+ NOK=1
+ echo '7 OK: 6 NOT OK: 1 TOTAL: 999'
7 OK: 6 NOT OK: 1 TOTAL: 999
+ for i in '`seq $RUN_TIMES`'
+ python tools/test.py -p tap --mode=release parallel/test-debug-port-numbers
1..1
not ok 1 parallel/test-debug-port-numbers
# TIMEOUT
# debug> debug> debug> debug> ��< Error: listen EADDRINUSE :::12349
# < Debugger listening on port 12347debug> �connecting to 127.0.0.1:12349 ..
# .�< Debugger listening on port 12346
# debug> �connecting to 127.0.0.1:12347 ...��< Debugger listening on port 12348< at Object.exports._errnoException (util.js:1007:11)
# < at exports._exceptionWithHostPort (util.js:1030:20)
# < at Agent.Server._listen2 (net.js:1253:14)
# < at listen (net.js:1289:10)
# < at Agent.Server.listen (net.js:1385:5)
# < at Object.start (_debug_agent.js:21:9)
# < at startup (node.js:74:44)
# < at node.js:444:3
#
# debug> debug> �connecting to 127.0.0.1:12348 ..debug> ok
# . ok
# debug> debug> �connecting to 127.0.0.1:12346 ... ok
# debug> ok
# debug> �break in test/parallel/test-debug-port-numbers.js:1
# �> 1 'use strict';
# � 2
# � 3 const common = require('../common');
# debug> �break in test/parallel/test-debug-port-numbers.js:1
# �> 1 'use strict';
# � 2
# � 3 const common = require('../common');
# debug> �break in test/parallel/test-debug-port-numbers.js:1
# �> 1 'use strict';
# � 2
# � 3 const common = require('../common');
# debug>
The commit that landed this test is dated October, but it only landed two days ago.
/cc @bnoordhuis
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
testIssues and PRs related to Node.js core tests and test infrastructure.Issues and PRs related to Node.js core tests and test infrastructure.
Activity
bnoordhuis commentedon May 28, 2016
I can reproduce and I figured it out, see #7037 for a workaround.
The problem is that the debugger process spawns the debuggee (a.k.a. the inferior) but doesn't always terminate it on exit. If you modify the test to send a SIGKILL to the debugger, the test always fails on the second run, because the inferior stays around, hogging the port.
test: work around debugger not killing inferior
test: work around debugger not killing inferior
test: work around debugger not killing inferior
test: work around debugger not killing inferior
test: work around debugger not killing inferior
test: work around debugger not killing inferior