test: fix child-process-fork-regr-gh-2847 again

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
This commit is contained in:
Santiago Gimeno 2016-02-10 19:51:32 +01:00 committed by Rich Trott
parent b55e58042c
commit 24667eeff8

View 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);