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-cluster-send-handle-twice #19700

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions test/parallel/test-cluster-send-handle-twice.js
Expand Up @@ -40,21 +40,20 @@ if (cluster.isMaster) {
}));
}
} else {
const server = net.createServer(function(socket) {
const server = net.createServer(common.mustCall((socket) => {
process.send('send-handle-1', socket);
process.send('send-handle-2', socket);
});
}));
Copy link
Member

Choose a reason for hiding this comment

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

This is very likely tested for very very often already.


server.listen(0, function() {
const client = net.connect({
host: 'localhost',
port: server.address().port
});
client.on('close', common.mustCall(() => { cluster.worker.disconnect(); }));
setTimeout(function() { client.end(); }, 50);
client.on('connect', () => { client.end(); });
}).on('error', function(e) {
console.error(e);
assert.fail('server.listen failed');
cluster.worker.disconnect();
});
}