summaryrefslogtreecommitdiff
path: root/test/parallel/test-cluster-disconnect-race.js
diff options
context:
space:
mode:
authorBrian White <mscdex@mscdex.net>2015-12-28 16:58:24 -0500
committerBrian White <mscdex@mscdex.net>2015-12-29 00:47:24 -0500
commitfd551c3f29d08bd94271e1759c33130b8b53646c (patch)
tree53846b11cf8073dead7bd74604965e6c5dfdd2f3 /test/parallel/test-cluster-disconnect-race.js
parent380912642787d39dc5960c7728e0bcc7725ac5c9 (diff)
downloadandroid-node-v8-fd551c3f29d08bd94271e1759c33130b8b53646c.tar.gz
android-node-v8-fd551c3f29d08bd94271e1759c33130b8b53646c.tar.bz2
android-node-v8-fd551c3f29d08bd94271e1759c33130b8b53646c.zip
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: https://github.com/nodejs/node/issues/4450 PR-URL: https://github.com/nodejs/node/pull/4457 Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test/parallel/test-cluster-disconnect-race.js')
-rw-r--r--test/parallel/test-cluster-disconnect-race.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/parallel/test-cluster-disconnect-race.js b/test/parallel/test-cluster-disconnect-race.js
index 40cfd919e3..97d55a20b1 100644
--- a/test/parallel/test-cluster-disconnect-race.js
+++ b/test/parallel/test-cluster-disconnect-race.js
@@ -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) {
@@ -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;
}