Skip to content

Commit

Permalink
test: ignore spurious 'EMFILE'
Browse files Browse the repository at this point in the history
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 May 19, 2017
1 parent 51664fc commit 6f21671
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/parallel/test-child-process-fork-regr-gh-2847.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down Expand Up @@ -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;
}
});
Expand Down

0 comments on commit 6f21671

Please sign in to comment.