Skip to content
Permalink
Browse files

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: #12698
Fixes: #10286
Refs: #3635 (comment)
Refs: #5178
Refs: #5179
Refs: #4005
Refs: #5121
Refs: #5422
Refs: #12621 (comment)
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information...
refack committed Apr 27, 2017
1 parent 51664fc commit 6f216710eb49436f0c372fbaf6da3e65ba9578c2
Showing with 8 additions and 3 deletions.
  1. +8 −3 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;
}
});

0 comments on commit 6f21671

Please sign in to comment.
You can’t perform that action at this time.