Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: ignore spurious 'EMFILE' #12698

Merged
merged 1 commit into from
May 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, should be an issue, so:

https://github.com/nodejs/node/pull/2847->https://github.com/nodejs/node/issues/2847

Also can you order this as in the guide? Should look like:

'use strict';
const common = require('../common');

// Before https://github.com/nodejs/node/issues/2847 a child process trying
// (asynchronously) to use the closed channel to it's creator caused a segfault.
 
const assert = require('assert');

// (asynchronously) to use the closed channel to it's creator caused a segfault.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's -> its

'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')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@refack could you put a brief two line explanation of why this error occurs in a comment above? When reading through tests mysteriously ignored errors are always a bit of code smell.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack.
PTAL

throw err;
}
});
Expand Down