From 849fda9631948cb3366cf54f641abfb6a1dcff4e Mon Sep 17 00:00:00 2001 From: Brian White Date: Sun, 27 Dec 2015 16:42:51 -0500 Subject: [PATCH] test: fix flaky child-process-fork-regr-gh-2847 Windows would die with ECONNRESET most times when running this particular test. This commit makes handling these errors more tolerable. PR-URL: https://github.com/nodejs/node/pull/4442 Reviewed-By: Fedor Indutny Reviewed-By: Rich Trott --- test/parallel/parallel.status | 1 - test/parallel/test-child-process-fork-regr-gh-2847.js | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status index ced1680ef9d6..4c41af84937a 100644 --- a/test/parallel/parallel.status +++ b/test/parallel/parallel.status @@ -7,7 +7,6 @@ prefix parallel [true] # This section applies to all platforms [$system==win32] -test-child-process-fork-regr-gh-2847 : PASS,FLAKY test-cluster-net-send : PASS,FLAKY test-cluster-shared-leak : PASS,FLAKY test-debug-no-context : PASS,FLAKY diff --git a/test/parallel/test-child-process-fork-regr-gh-2847.js b/test/parallel/test-child-process-fork-regr-gh-2847.js index f035b7fdc89e..78856cb55ede 100644 --- a/test/parallel/test-child-process-fork-regr-gh-2847.js +++ b/test/parallel/test-child-process-fork-regr-gh-2847.js @@ -18,6 +18,13 @@ if (!cluster.isMaster) { } var server = net.createServer(function(s) { + if (common.isWindows) { + s.on('error', function(err) { + // Prevent possible ECONNRESET errors from popping up + if (err.code !== 'ECONNRESET' || sendcount === 0) + throw err; + }); + } setTimeout(function() { s.destroy(); }, 100);