File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ const N = 80;
14
14
15
15
if ( process . argv [ 2 ] !== 'child' ) {
16
16
for ( let i = 0 ; i < N ; ++ i ) {
17
- const worker = fork ( __filename , [ 'child' , common . PORT + i ] ) ;
17
+ const worker = fork ( __filename , [ 'child' ] ) ;
18
18
worker . once ( 'message' , common . mustCall ( ( msg , handle ) => {
19
19
assert . strictEqual ( msg , 'handle' ) ;
20
20
assert . ok ( handle ) ;
@@ -33,7 +33,6 @@ if (process.argv[2] !== 'child') {
33
33
}
34
34
} else {
35
35
let socket ;
36
- const port = process . argv [ 3 ] ;
37
36
let cbcalls = 0 ;
38
37
function socketConnected ( ) {
39
38
if ( ++ cbcalls === 2 )
@@ -47,7 +46,8 @@ if (process.argv[2] !== 'child') {
47
46
} ) ;
48
47
socketConnected ( ) ;
49
48
} ) ;
50
- server . listen ( port , common . localhostIPv4 , ( ) => {
49
+ server . listen ( 0 , common . localhostIPv4 , ( ) => {
50
+ const port = server . address ( ) . port ;
51
51
socket = net . connect ( port , common . localhostIPv4 , socketConnected ) ;
52
52
} ) ;
53
53
}
You can’t perform that action at this time.
0 commit comments