test: replace common.PORT in test-cluster-dgram-2 by Trott · Pull Request #12492 · nodejs/node

Conversation

@Trott

Replace common.PORT with available port assigned by the operating
system in test-cluster-dgram-2.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test dgram cluster

Replace common.PORT with available port assigned by the operating
system in test-cluster-dgram-2.

@Trott Trott added cluster

Issues and PRs related to the cluster subsystem.

dgram

Issues and PRs related to the dgram subsystem / UDP.

test

Issues and PRs related to the tests.

labels

Apr 18, 2017

@Trott Trott mentioned this pull request

Apr 18, 2017

64 tasks

cjihrig

hiroppy

jasnell

// sending until disconnect.
const interval = setInterval(() => {
socket.send(buf, 0, buf.length, common.PORT, '127.0.0.1');
socket.send(buf, 0, buf.length, process.env.BOUNDPORT, '127.0.0.1');

Choose a reason for hiding this comment

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

may be worthwhile adding an assert to make sure process.env.BOUNDPORT is set

santigimeno

const port = socket.address().port;
// Fork workers.
for (let i = 0; i < NUM_WORKERS; i++)
cluster.fork({BOUNDPORT: port});

Choose a reason for hiding this comment

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

Nice!

@santigimeno

It looks like a duplicate of #12487

@Trott

Labels

cluster

Issues and PRs related to the cluster subsystem.

dgram

Issues and PRs related to the dgram subsystem / UDP.

test

Issues and PRs related to the tests.