Skip to content

Commit 6f53c09

Browse files
lpincamarco-ippolito
authored andcommitted
test: move test-http-max-sockets to parallel
PR-URL: #54977 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Jake Yuesong Li <[email protected]>
1 parent aba9dc7 commit 6f53c09

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
Lines changed: 5 additions & 4 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

2525
// Make sure http server doesn't wait for socket pool to establish connections
2626
// https://github.com/nodejs/node-v0.x-archive/issues/877
@@ -40,13 +40,14 @@ const server = http.createServer(function(req, res){
4040
res.end('Hello World\n');
4141
});
4242

43-
constaddrString=agent.getName({host: '127.0.0.1',port: common.PORT});
43+
server.listen(0,'127.0.0.1',function(){
44+
const{ port }=server.address();
45+
constaddrString=agent.getName({host: '127.0.0.1', port });
4446

45-
server.listen(common.PORT,'127.0.0.1',function(){
4647
for(leti=0;i<N;i++){
4748
constoptions={
4849
host: '127.0.0.1',
49-
port: common.PORT
50+
port
5051
};
5152

5253
constreq=http.get(options,function(res){

0 commit comments

Comments
(0)