Skip to content

Commit f547ca6

Browse files
committed
test: add logging for test-debug-port-cluster
The test is currently flaky and CI provides no real information because the test times out rather than failing on an assertion. Add logging to gather more information about the failure. Refs: #6754
1 parent f4f6c6e commit f547ca6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
4-
var spawn = require('child_process').spawn;
2+
const common = require('../common');
3+
const assert = require('assert');
4+
const spawn = require('child_process').spawn;
55

66
const PORT_MIN = common.PORT + 1337;
77
const PORT_MAX = PORT_MIN + 2;
88

9-
var args = [
9+
const args = [
1010
'--debug=' + PORT_MIN,
1111
common.fixturesDir + '/clustered-server/app.js'
1212
];
@@ -16,12 +16,12 @@ child.stderr.setEncoding('utf8');
1616

1717
let stderr = '';
1818
child.stderr.on('data', (data) => {
19+
process.stderr.write(`[DATA] ${data}`);
1920
stderr += data;
20-
if (child.killed !== true && stderr.includes('all workers are running'))
21+
if (child.killed !== true && stderr.includes('all workers are running')) {
2122
child.kill();
22-
});
23-
24-
process.on('exit', () => {
25-
for (let port = PORT_MIN; port <= PORT_MAX; port += 1)
26-
assert(stderr.includes(`Debugger listening on port ${port}`));
23+
for (let port = PORT_MIN; port <= PORT_MAX; port += 1) {
24+
assert(stderr.includes(`Debugger listening on port ${port}`));
25+
}
26+
}
2727
});

0 commit comments

Comments
 (0)