test: move test-http-max-sockets to parallel

PR-URL: https://github.com/nodejs/node/pull/54977
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
This commit is contained in:
Luigi Pinca 2024-09-20 11:57:21 +02:00 committed by GitHub
parent 636b3432d3
commit a6ed2148a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 4 deletions

View File

@ -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) {