diff options
author | Jon Moss <me@jonathanmoss.me> | 2017-09-01 12:37:41 -0400 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2017-09-10 23:56:30 -0300 |
commit | af15b755c08370d4224541205f9e3e9ff54a4325 (patch) | |
tree | 00da6ddcf5ad8650b2852da3542f59872c230d64 /test/parallel/test-http-agent-uninitialized-with-handle.js | |
parent | 45357d055694000b78a27e1959f304f5838005be (diff) | |
download | android-node-v8-af15b755c08370d4224541205f9e3e9ff54a4325.tar.gz android-node-v8-af15b755c08370d4224541205f9e3e9ff54a4325.tar.bz2 android-node-v8-af15b755c08370d4224541205f9e3e9ff54a4325.zip |
test: move common.PORT tests to sequential
Reasons:
- `test-async-wrap-getasyncid` binds a handle, so move to
sequential because port cannot be already in use.
- `test-dgram-implicit-bind-failure` requires a hardcoded
port number to properly send socket packet.
- `test-http-agent-uninitialized-with-handle` requires a
hardcoded port number to properly send http request.
- `test-http-agent-uninitialized` requires a hardcoded port
number to properly send http request.
- `test-net-localport` requires a hardcoded port number
for assertions.
In addition this replaces two common.PORTs with a dynamic port.
PR-URL: https://github.com/nodejs/node/pull/15151
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'test/parallel/test-http-agent-uninitialized-with-handle.js')
-rw-r--r-- | test/parallel/test-http-agent-uninitialized-with-handle.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/parallel/test-http-agent-uninitialized-with-handle.js b/test/parallel/test-http-agent-uninitialized-with-handle.js index fab32ade45..77f0177173 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 |