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>
This commit is contained in:
parent
d9da0a9912
commit
bf7edaa3c9
@ -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(() => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user