summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-no-read-no-dump.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2016-06-28 17:14:19 -0700
committerRich Trott <rtrott@gmail.com>2016-06-30 22:45:36 -0700
commitabce60cec050f85f372b102a50220445e128bdfb (patch)
tree6fa4f2326d4408b83a70d35570c73b35d3805887 /test/parallel/test-http-no-read-no-dump.js
parent42de4bb819da32994d35de54aec17195af6636a8 (diff)
downloadandroid-node-v8-abce60cec050f85f372b102a50220445e128bdfb.tar.gz
android-node-v8-abce60cec050f85f372b102a50220445e128bdfb.tar.bz2
android-node-v8-abce60cec050f85f372b102a50220445e128bdfb.zip
test: remove common.PORT from http tests
PR-URL: https://github.com/nodejs/node/pull/7467 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-http-no-read-no-dump.js')
-rw-r--r--test/parallel/test-http-no-read-no-dump.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/parallel/test-http-no-read-no-dump.js b/test/parallel/test-http-no-read-no-dump.js
index c509146c0a..17d36c56b2 100644
--- a/test/parallel/test-http-no-read-no-dump.js
+++ b/test/parallel/test-http-no-read-no-dump.js
@@ -15,16 +15,18 @@ const server = http.createServer((req, res) => {
res.end();
onPause();
});
-}).listen(common.PORT, common.mustCall(() => {
+}).listen(0, common.mustCall(() => {
const agent = new http.Agent({
maxSockets: 1,
keepAlive: true
});
+ const port = server.address().port;
+
const post = http.request({
- agent: agent,
+ agent,
method: 'POST',
- port: common.PORT,
+ port,
}, common.mustCall((res) => {
res.resume();
@@ -41,9 +43,9 @@ const server = http.createServer((req, res) => {
post.write('initial');
http.request({
- agent: agent,
+ agent,
method: 'GET',
- port: common.PORT,
+ port,
}, common.mustCall((res) => {
server.close();
res.connection.end();