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: fix flaky test-child-process-fork-net #21012

Closed
Closed
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: 10 additions & 1 deletion test/parallel/test-child-process-fork-net.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ if (process.argv[2] === 'child') {
console.log('PARENT: server closed');
callback();
});
server.on('error', (err) => {
if (err && err.code !== 'EPIPE') {
throw err;
}
});
// Don't listen on the same port, because SmartOS sometimes says
// that the server's fd is closed, but it still cannot listen
// on the same port again.
Expand All @@ -175,7 +180,11 @@ if (process.argv[2] === 'child') {
connect.on('close', function() {
console.log('CLIENT: closed');
assert.strictEqual(store, 'echo');
server.close();
server.close((err) => {
if (err && err.code !== 'EPIPE') {
throw err;
}
});
});
});
}
Expand Down