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

tests: remove common.PORT from cluster worker wait server close #12466

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/parallel/test-cluster-worker-wait-server-close.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if (cluster.isWorker) {
// Wait for any data, then close connection
socket.write('.');
socket.on('data', common.noop);
}).listen(common.PORT, common.localhostIPv4);
}).listen(0, common.localhostIPv4);

server.once('close', function() {
serverClosed = true;
Expand All @@ -33,8 +33,8 @@ if (cluster.isWorker) {
const worker = cluster.fork();

// Disconnect worker when it is ready
worker.once('listening', function() {
const socket = net.createConnection(common.PORT, common.localhostIPv4);
worker.once('listening', function(address) {
const socket = net.createConnection(address.port, common.localhostIPv4);

socket.on('connect', function() {
socket.on('data', function() {
Expand Down