mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
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:
1 parent
21d2bdd3ce
commit
dce4947335
1 file changed
+3
-4
@@ -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(() => {
|
||||
|
||||
Reference in new issue
Block a user