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:
Anna Henningsen authored and Michaël Zasso committed 2019-07-02 11:46:55 +02:00
1 parent 21d2bdd3ce
commit dce4947335
1 file changed
+3 -4
+3 -4
View File
@@ -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(() => {