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: replace common.PORT in test-cluster-dgram-2 #12492

Closed
wants to merge 1 commit into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Apr 18, 2017

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
@@ -81,7 +82,7 @@ function worker() {
// There is no guarantee that a sent dgram packet will be received so keep
// 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');
Copy link
Member

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

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

Choose a reason for hiding this comment

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

Nice!

@santigimeno
Copy link
Member

It looks like a duplicate of #12487

@Trott
Copy link
Member Author

Trott commented Apr 23, 2017

Closing in favor of #12487

@Trott Trott closed this Apr 23, 2017
@Trott Trott deleted the dgram2 branch January 13, 2022 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants