Skip to content

Commit

Permalink
test: fix flaky cluster-disconnect-race
Browse files Browse the repository at this point in the history
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: nodejs#4450
PR-URL: nodejs#4457
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
mscdex authored and Michael Scovetta committed Apr 2, 2016
1 parent 2d70538 commit 6f0fe6a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/parallel/test-cluster-disconnect-race.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ const common = require('../common');
const assert = require('assert');
const net = require('net');
const cluster = require('cluster');

if (common.isWindows) {
console.log('1..0 # Skipped: This test does not apply to Windows.');
return;
}

cluster.schedulingPolicy = cluster.SCHED_NONE;

if (cluster.isMaster) {
Expand All @@ -19,9 +25,9 @@ if (cluster.isMaster) {
worker2.on('online', common.mustCall(worker2.disconnect));
}));

cluster.on('exit', function(worker, code) {
cluster.on('exit', common.mustCall(function(worker, code) {
assert.strictEqual(code, 0, 'worker exited with error');
});
}, 2));

return;
}
Expand Down

0 comments on commit 6f0fe6a

Please sign in to comment.