Skip to content

Commit

Permalink
test: fix flaky child-process-fork-regr-gh-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: #4442
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
mscdex authored and Fishrock123 committed Jan 6, 2016
1 parent 684eb32 commit 03c4bc7
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 03c4bc7

Please sign in to comment.