Skip to content

Commit fd551c3

Browse files
committed
test: fix flaky cluster-disconnect-race
On single core Windows systems, process.send() would cause an EPIPE because of the ordering of the IPC channel disconnect and the process.send(). The test was originally only relevant for non-Windows platforms, so this commit merely skips the test on Windows. Fixes: #4450 PR-URL: #4457 Reviewed-By: Rich Trott <[email protected]>
1 parent 3809126 commit fd551c3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/parallel/test-cluster-disconnect-race.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ const common = require('../common');
77
const assert = require('assert');
88
const net = require('net');
99
const cluster = require('cluster');
10+
11+
if (common.isWindows) {
12+
console.log('1..0 # Skipped: This test does not apply to Windows.');
13+
return;
14+
}
15+
1016
cluster.schedulingPolicy = cluster.SCHED_NONE;
1117

1218
if (cluster.isMaster) {
@@ -19,9 +25,9 @@ if (cluster.isMaster) {
1925
worker2.on('online', common.mustCall(worker2.disconnect));
2026
}));
2127

22-
cluster.on('exit', function(worker, code) {
28+
cluster.on('exit', common.mustCall(function(worker, code) {
2329
assert.strictEqual(code, 0, 'worker exited with error');
24-
});
30+
}, 2));
2531

2632
return;
2733
}

0 commit comments

Comments
 (0)