Skip to content

Commit

Permalink
test: change common.PORT to arbitrary port
Browse files Browse the repository at this point in the history
Change common.PORT to arbitrary port in
test-child-process-fork-getconnections to prepare for moving that test
from sequential to parallel.

PR-URL: #30749
Reviewed-By: Denys Otrishko <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
Trott authored and targos committed Dec 9, 2019
1 parent c3ac4c8 commit 50ab1fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/sequential/test-child-process-fork-getconnections.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';
const common = require('../common');
require('../common');
const assert = require('assert');
const fork = require('child_process').fork;
const net = require('net');
Expand Down Expand Up @@ -79,7 +79,7 @@ if (process.argv[2] === 'child') {
server.on('listening', function() {
let j = count;
while (j--) {
const client = net.connect(common.PORT, '127.0.0.1');
const client = net.connect(server.address().port, '127.0.0.1');
client.on('close', function() {
disconnected += 1;
});
Expand Down Expand Up @@ -110,7 +110,7 @@ if (process.argv[2] === 'child') {
closeEmitted = true;
});

server.listen(common.PORT, '127.0.0.1');
server.listen(0, '127.0.0.1');

process.on('exit', function() {
assert.strictEqual(sent, count);
Expand Down

0 comments on commit 50ab1fa

Please sign in to comment.