Skip to content
This repository has been archived by the owner on Oct 16, 2021. It is now read-only.

Commit

Permalink
test: fix flaky child-process-fork-regr-nodejsgh-2847
Browse files Browse the repository at this point in the history
Windows would die with ECONNRESET most times when running
this particular test. This commit makes handling these errors
more tolerable.

PR-URL: nodejs/node#4442
Reviewed-By: Fedor Indutny <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
mscdex authored and Myles Borins committed Feb 15, 2016
1 parent 393e569 commit 6809c2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion test/parallel/parallel.status
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions test/parallel/test-child-process-fork-regr-gh-2847.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6809c2b

Please sign in to comment.