Skip to content

Commit

Permalink
test: do not use fixed port in async-hooks/test-httparser-reuse
Browse files Browse the repository at this point in the history
Otherwise this was failing on machines which already had a service
running on port 3000.

PR-URL: nodejs#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>
  • Loading branch information
addaleax authored and Trott committed Jun 28, 2019
1 parent d9da0a9 commit bf7edaa
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/async-hooks/test-httparser-reuse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit bf7edaa

Please sign in to comment.