Skip to content

Commit 5b012f5

Browse files
lpincatargos
authored andcommitted
test: move test-http-max-sockets to parallel
PR-URL: #54977 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
1 parent 22b4139 commit 5b012f5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/sequential/test-http-max-sockets.js test/parallel/test-http-max-sockets.js

+5-4
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

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-
const addrString = 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+
const addrString = agent.getName({ host: '127.0.0.1', port });
4446

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

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

0 commit comments

Comments
 (0)