test: replace common.PORT in test-cluster-dgram-2 by Trott · Pull Request #12492 · nodejs/node
Conversation
Replace common.PORT with available port assigned by the operating
system in test-cluster-dgram-2.
Checklist
-
make -j4 test(UNIX), orvcbuild test(Windows) passes - commit message follows commit guidelines
Affected core subsystem(s)
test dgram cluster
labels
Apr 18, 2017
Trott
mentioned this pull request
64 tasks
| // 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
| 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!
It looks like a duplicate of #12487
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters