Skip to content

Commit e7966bc

Browse files
MurkyMeowtargos
authored andcommitted
test: unhardcode server port
This is needed to avoid possible conflicts when running multiple tests in parallel PR-URL: #27908 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]> Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
1 parent b83571d commit e7966bc

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/parallel/test-http-server-delete-parser.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ const server = http.createServer(common.mustCall((req, res) => {
1212
res.end();
1313
}));
1414

15-
server.listen(1337, '127.0.0.1');
16-
server.unref();
17-
18-
const req = http.request({
19-
port: 1337,
20-
host: '127.0.0.1',
21-
method: 'GET',
22-
});
15+
server.listen(0, '127.0.0.1', common.mustCall(() => {
16+
const req = http.request({
17+
port: server.address().port,
18+
host: '127.0.0.1',
19+
method: 'GET',
20+
});
21+
req.end();
22+
}));
2323

24-
req.end();
24+
server.unref();

0 commit comments

Comments
 (0)