From d2d7c94d8787c5b4708d55592e0b9c26710b7a04 Mon Sep 17 00:00:00 2001 From: Brian White Date: Mon, 28 Dec 2015 16:58:24 -0500 Subject: [PATCH] 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 --- test/parallel/test-cluster-disconnect-race.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-cluster-disconnect-race.js b/test/parallel/test-cluster-disconnect-race.js index 40cfd919e3e964..97d55a20b1ac51 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; }