From a6ed2148a0744cb160d4e345f505f3a227b1133a Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Fri, 20 Sep 2024 11:57:21 +0200 Subject: [PATCH] test: move test-http-max-sockets to parallel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/54977 Reviewed-By: Michaƫl Zasso Reviewed-By: Jake Yuesong Li --- test/{sequential => parallel}/test-http-max-sockets.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) rename test/{sequential => parallel}/test-http-max-sockets.js (92%) diff --git a/test/sequential/test-http-max-sockets.js b/test/parallel/test-http-max-sockets.js similarity index 92% rename from test/sequential/test-http-max-sockets.js rename to test/parallel/test-http-max-sockets.js index 24629448f7ac77..f70860817c0f7a 100644 --- a/test/sequential/test-http-max-sockets.js +++ b/test/parallel/test-http-max-sockets.js @@ -20,7 +20,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; -const common = require('../common'); +require('../common'); // Make sure http server doesn't wait for socket pool to establish connections // https://github.com/nodejs/node-v0.x-archive/issues/877 @@ -40,13 +40,14 @@ const server = http.createServer(function(req, res) { res.end('Hello World\n'); }); -const addrString = agent.getName({ host: '127.0.0.1', port: common.PORT }); +server.listen(0, '127.0.0.1', function() { + const { port } = server.address(); + const addrString = agent.getName({ host: '127.0.0.1', port }); -server.listen(common.PORT, '127.0.0.1', function() { for (let i = 0; i < N; i++) { const options = { host: '127.0.0.1', - port: common.PORT + port }; const req = http.get(options, function(res) {