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: #28312
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
addaleax authored and targos committed Jul 2, 2019
1 parent 21d2bdd commit dce4947
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 dce4947

Please sign in to comment.