Skip to content

Commit 6cedeb1

Browse files
Trotttargos
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 <shishugi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 7d5ab8b commit 6cedeb1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
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-
constcommon=require('../common');
23+
require('../common');
2424
constassert=require('assert');
2525
constfork=require('child_process').fork;
2626
constnet=require('net');
@@ -79,7 +79,7 @@ if (process.argv[2] === 'child') {
7979
server.on('listening',function(){
8080
letj=count;
8181
while(j--){
82-
constclient=net.connect(common.PORT,'127.0.0.1');
82+
constclient=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)