Skip to content

Commit dce4947

Browse files
addaleaxtargos
authored andcommitted
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: #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]>
1 parent 21d2bdd commit dce4947

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/async-hooks/test-httparser-reuse.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ const server = http.createServer((req, res) => {
4747
res.end();
4848
});
4949

50-
const PORT = 3000;
51-
const url = `http://127.0.0.1:${PORT}`;
52-
53-
server.listen(PORT, common.mustCall(() => {
50+
server.listen(0, common.mustCall(() => {
51+
const PORT = server.address().port;
52+
const url = `http://127.0.0.1:${PORT}`;
5453
http.get(url, common.mustCall(() => {
5554
server.close(common.mustCall(() => {
5655
server.listen(PORT, common.mustCall(() => {

0 commit comments

Comments
 (0)