From c83c4a1250d420f09115c8d394f57c39914bf04a Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 27 Apr 2017 19:46:31 -0700 Subject: [PATCH] wip: test: make regression test reliable --- .../test-child-process-fork-regr-gh-2847.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) rename test/{parallel => sequential}/test-child-process-fork-regr-gh-2847.js (74%) diff --git a/test/parallel/test-child-process-fork-regr-gh-2847.js b/test/sequential/test-child-process-fork-regr-gh-2847.js similarity index 74% rename from test/parallel/test-child-process-fork-regr-gh-2847.js rename to test/sequential/test-child-process-fork-regr-gh-2847.js index 0bcf4bf9a1c88f..ad4d39384025bc 100644 --- a/test/parallel/test-child-process-fork-regr-gh-2847.js +++ b/test/sequential/test-child-process-fork-regr-gh-2847.js @@ -17,7 +17,6 @@ if (!cluster.isMaster) { const server = net.createServer(function(s) { if (common.isWindows) { s.on('error', function(err) { - // Prevent possible ECONNRESET errors from popping up if (err.code !== 'ECONNRESET') throw err; }); @@ -36,10 +35,8 @@ const server = net.createServer(function(s) { // Errors can happen if this connection // is still happening while the server has been closed. s.on('error', function(err) { - if ((err.code !== 'ECONNRESET') && - ((err.code !== 'ECONNREFUSED'))) { + if (err.code !== 'ECONNREFUSED') throw err; - } }); } @@ -53,14 +50,7 @@ const server = net.createServer(function(s) { send(function(err) { assert.ifError(err); send(function(err) { - // Ignore errors when sending the second handle because the worker - // may already have exited. - if (err) { - if ((err.message !== 'channel closed') && - (err.code !== 'ECONNREFUSED')) { - throw err; - } - } + assert.ifError(err); }); }); });