Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: fix debug-port-cluster flakiness
The test was assuming that the 'all workers are running' text was received
by the parent process in a separate chunk from the other texts. This might
not always be the case, causing the test never reaches the exit condition.
Fix it by checking every line received.
  • Loading branch information
santigimeno committed Dec 12, 2015
commit b8eed1e61eef7a964462b31e31474bf98f3fc09d
17 changes: 9 additions & 8 deletions test/parallel/test-debug-port-cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ child.stderr.on('data', function(data) {
var lines = data.toString().replace(/\r/g, '').trim().split('\n');
var line = lines[0];

lines.forEach(function(ln) { console.log('> ' + ln); } );

if (line === 'all workers are running') {
assertOutputLines();
process.exit();
} else {
outputLines = outputLines.concat(lines);
}
lines.forEach((ln, i) => {
console.log(i + '> ' + ln);
if (ln === 'all workers are running') {
assertOutputLines();
process.exit();
} else {
outputLines.push(ln);
}
});
});

process.on('exit', function onExit() {
Expand Down