Skip to content

Commit

Permalink
test: unhardcode server port
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
MurkyMeow authored and targos committed May 28, 2019
1 parent b83571d commit e7966bc
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/parallel/test-http-server-delete-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ const server = http.createServer(common.mustCall((req, res) => {
res.end();
}));

server.listen(1337, '127.0.0.1');
server.unref();

const req = http.request({
port: 1337,
host: '127.0.0.1',
method: 'GET',
});
server.listen(0, '127.0.0.1', common.mustCall(() => {
const req = http.request({
port: server.address().port,
host: '127.0.0.1',
method: 'GET',
});
req.end();
}));

req.end();
server.unref();

0 comments on commit e7966bc

Please sign in to comment.