Skip to content

Commit 6f21671

Browse files
committed
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 <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 51664fc commit 6f21671

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/parallel/test-child-process-fork-regr-gh-2847.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Before https://github.com/nodejs/node/pull/2847 a child process trying
2+
// (asynchronously) to use the closed channel to it's creator caused a segfault.
13
'use strict';
24

35
const common = require('../common');
@@ -33,11 +35,14 @@ const server = net.createServer(function(s) {
3335
worker.send({}, s, callback);
3436
});
3537

36-
// Errors can happen if this connection
37-
// is still happening while the server has been closed.
38+
// https://github.com/nodejs/node/issues/3635#issuecomment-157714683
39+
// ECONNREFUSED or ECONNRESET errors can happen if this connection is still
40+
// establishing while the server has already closed.
41+
// EMFILE can happen if the worker __and__ the server had already closed.
3842
s.on('error', function(err) {
3943
if ((err.code !== 'ECONNRESET') &&
40-
((err.code !== 'ECONNREFUSED'))) {
44+
(err.code !== 'ECONNREFUSED') &&
45+
(err.code !== 'EMFILE')) {
4146
throw err;
4247
}
4348
});

0 commit comments

Comments
 (0)