test: fix flaky child-process-fork-regr-gh-2847
authorBrian White <mscdex@mscdex.net>
Sun, 27 Dec 2015 21:42:51 +0000 (16:42 -0500)
committerMyles Borins <mborins@us.ibm.com>
Mon, 15 Feb 2016 19:30:23 +0000 (11:30 -0800)
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 <fedor.indutny@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
test/parallel/parallel.status
test/parallel/test-child-process-fork-regr-gh-2847.js

index ced1680..4c41af8 100644 (file)
@@ -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
index f035b7f..78856cb 100644 (file)
@@ -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);