diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-06-19 19:30:30 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-06-27 23:40:30 -0700 |
commit | bf7edaa3c9075b58352a618f1a60785a481902f7 (patch) | |
tree | 209c47ff23f159c33bbef7001bffe1488b7d5aa1 | |
parent | d9da0a9912aeb5a720c863bcd234e3934d895b9c (diff) | |
download | android-node-v8-bf7edaa3c9075b58352a618f1a60785a481902f7.tar.gz android-node-v8-bf7edaa3c9075b58352a618f1a60785a481902f7.tar.bz2 android-node-v8-bf7edaa3c9075b58352a618f1a60785a481902f7.zip |
test: do not use fixed port in async-hooks/test-httparser-reuse
Otherwise this was failing on machines which already had a service
running on port 3000.
PR-URL: https://github.com/nodejs/node/pull/28312
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
-rw-r--r-- | test/async-hooks/test-httparser-reuse.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/test/async-hooks/test-httparser-reuse.js b/test/async-hooks/test-httparser-reuse.js index 06441562e0..70248970df 100644 --- a/test/async-hooks/test-httparser-reuse.js +++ b/test/async-hooks/test-httparser-reuse.js @@ -47,10 +47,9 @@ const server = http.createServer((req, res) => { res.end(); }); -const PORT = 3000; -const url = `http://127.0.0.1:${PORT}`; - -server.listen(PORT, common.mustCall(() => { +server.listen(0, common.mustCall(() => { + const PORT = server.address().port; + const url = `http://127.0.0.1:${PORT}`; http.get(url, common.mustCall(() => { server.close(common.mustCall(() => { server.listen(PORT, common.mustCall(() => { |