diff --git a/test/parallel/test-http-agent-uninitialized-with-handle.js b/test/parallel/test-http-agent-uninitialized-with-handle.js index fab32ade45efe4..77f01771734c87 100644 --- a/test/parallel/test-http-agent-uninitialized-with-handle.js +++ b/test/parallel/test-http-agent-uninitialized-with-handle.js @@ -13,11 +13,12 @@ socket._handle = { ref() { }, readStart() { }, }; -const req = new http.ClientRequest(`http://localhost:${common.PORT}/`); const server = http.createServer(common.mustCall((req, res) => { res.end(); -})).listen(common.PORT, common.mustCall(() => { +})).listen(0, common.mustCall(() => { + const req = new http.ClientRequest(`http://localhost:${server.address().port}/`); + // Manually add the socket without a _handle. agent.freeSockets[agent.getName(req)] = [socket]; // Now force the agent to use the socket and check that _handle exists before diff --git a/test/parallel/test-http-agent-uninitialized.js b/test/parallel/test-http-agent-uninitialized.js index c522b5fdbd43e9..dbb38e3b0f9847 100644 --- a/test/parallel/test-http-agent-uninitialized.js +++ b/test/parallel/test-http-agent-uninitialized.js @@ -8,11 +8,12 @@ const agent = new http.Agent({ keepAlive: true, }); const socket = new net.Socket(); -const req = new http.ClientRequest(`http://localhost:${common.PORT}/`); const server = http.createServer(common.mustCall((req, res) => { res.end(); -})).listen(common.PORT, common.mustCall(() => { +})).listen(0, common.mustCall(() => { + const req = new http.ClientRequest(`http://localhost:${server.address().port}/`); + // Manually add the socket without a _handle. agent.freeSockets[agent.getName(req)] = [socket]; // Now force the agent to use the socket and check that _handle exists before diff --git a/test/parallel/test-async-wrap-getasyncid.js b/test/sequential/test-async-wrap-getasyncid.js similarity index 100% rename from test/parallel/test-async-wrap-getasyncid.js rename to test/sequential/test-async-wrap-getasyncid.js diff --git a/test/parallel/test-dgram-implicit-bind-failure.js b/test/sequential/test-dgram-implicit-bind-failure.js similarity index 100% rename from test/parallel/test-dgram-implicit-bind-failure.js rename to test/sequential/test-dgram-implicit-bind-failure.js diff --git a/test/parallel/test-net-localport.js b/test/sequential/test-net-localport.js similarity index 100% rename from test/parallel/test-net-localport.js rename to test/sequential/test-net-localport.js