From e279eb5aa381b4026b08cb0c12d64135256461f9 Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Thu, 27 Apr 2017 10:02:46 -0400 Subject: [PATCH] test: ignore spurious 'EMFILE' According to the explanation in #3635#issuecomment-157714683 And as a continuation to #5422 we also ignore EMFILE "No more file descriptors are available,so no more files can be opened" PR-URL: https://github.com/nodejs/node/pull/12698 Fixes: https://github.com/nodejs/node/issues/10286 Refs: https://github.com/nodejs/node/issues/3635#issuecomment-157714683 Refs: https://github.com/nodejs/node/pull/5178 Refs: https://github.com/nodejs/node/pull/5179 Refs: https://github.com/nodejs/node/pull/4005 Refs: https://github.com/nodejs/node/pull/5121 Refs: https://github.com/nodejs/node/pull/5422 Refs: https://github.com/nodejs/node/pull/12621#issuecomment-297701459 Reviewed-By: Gibson Fahnestock Reviewed-By: Santiago Gimeno Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- test/parallel/test-child-process-fork-regr-gh-2847.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-child-process-fork-regr-gh-2847.js b/test/parallel/test-child-process-fork-regr-gh-2847.js index fe95e8dbb5b4ac..923e2a280a93ea 100644 --- a/test/parallel/test-child-process-fork-regr-gh-2847.js +++ b/test/parallel/test-child-process-fork-regr-gh-2847.js @@ -1,3 +1,5 @@ +// Before https://github.com/nodejs/node/pull/2847 a child process trying +// (asynchronously) to use the closed channel to it's creator caused a segfault. 'use strict'; const common = require('../common'); @@ -33,11 +35,14 @@ const server = net.createServer(function(s) { worker.send({}, s, callback); }); - // Errors can happen if this connection - // is still happening while the server has been closed. + // https://github.com/nodejs/node/issues/3635#issuecomment-157714683 + // ECONNREFUSED or ECONNRESET errors can happen if this connection is still + // establishing while the server has already closed. + // EMFILE can happen if the worker __and__ the server had already closed. s.on('error', function(err) { if ((err.code !== 'ECONNRESET') && - ((err.code !== 'ECONNREFUSED'))) { + (err.code !== 'ECONNREFUSED') && + (err.code !== 'EMFILE')) { throw err; } });