test: fix child-process-fork-regr-gh-2847 again
authorSantiago Gimeno <santiago.gimeno@gmail.com>
Wed, 10 Feb 2016 18:51:32 +0000 (19:51 +0100)
committerMyles Borins <mborins@us.ibm.com>
Wed, 2 Mar 2016 22:01:11 +0000 (14:01 -0800)
Windows is still sometimes failing with ECONNRESET. Bring back the
handling of this error as was initially introduced in PR #4442.

PR-URL: https://github.com/nodejs/node/pull/5179
Reviewed-By: Rich Trott <rtrott@gmail.com>
Fixes: https://github.com/nodejs/node/issues/3635
test/parallel/test-child-process-fork-regr-gh-2847.js

index ad056426428c0d3d3a73259bed2c015f42ee2691..df13b79f4e25684953ea370bdc1d3e4875e8ee90 100644 (file)
@@ -15,6 +15,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')
+        throw err;
+    });
+  }
   setTimeout(function() {
     s.destroy();
   }, 100);