Skip to content

Commit 096e337

Browse files
TrottBethGriggs
authored andcommitted
test: change common.PORT to arbitrary port
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]>
1 parent 8a9243a commit 096e337

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/sequential/test-child-process-fork-getconnections.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121

2222
'use strict';
23-
const common = require('../common');
23+
require('../common');
2424
const assert = require('assert');
2525
const fork = require('child_process').fork;
2626
const net = require('net');
@@ -79,7 +79,7 @@ if (process.argv[2] === 'child') {
7979
server.on('listening', function() {
8080
let j = count;
8181
while (j--) {
82-
const client = net.connect(common.PORT, '127.0.0.1');
82+
const client = net.connect(server.address().port, '127.0.0.1');
8383
client.on('close', function() {
8484
disconnected += 1;
8585
});
@@ -110,7 +110,7 @@ if (process.argv[2] === 'child') {
110110
closeEmitted = true;
111111
});
112112

113-
server.listen(common.PORT, '127.0.0.1');
113+
server.listen(0, '127.0.0.1');
114114

115115
process.on('exit', function() {
116116
assert.strictEqual(sent, count);

0 commit comments

Comments
 (0)