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 <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
refack authored and MylesBorins committed Jul 17, 2017
1 parent 3e5e38e commit e279eb5
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 e279eb5

Please sign in to comment.