Browse Source

test: remove `common.PORT` from test-tlswrap

`test/async-hooks/test/test-tlswrap.js` uses `common.PORT` but
async-hooks tests are run in parallel. Another test using port 0 could
result in a port collision. Remove `common.PORT` from the test.

PR-URL: https://github.com/nodejs/node/pull/15742
Ref: https://github.com/nodejs/node/issues/14404#issuecomment-333672346
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
v9.x-staging
Rich Trott 8 years ago
parent
commit
ddbf07ab89
  1. 4
      test/async-hooks/test-tlswrap.js

4
test/async-hooks/test-tlswrap.js

@ -25,7 +25,7 @@ const server = tls
}) })
.on('listening', common.mustCall(onlistening)) .on('listening', common.mustCall(onlistening))
.on('secureConnection', common.mustCall(onsecureConnection)) .on('secureConnection', common.mustCall(onsecureConnection))
.listen(common.PORT); .listen(0);
let svr, client; let svr, client;
function onlistening() { function onlistening() {
@ -33,7 +33,7 @@ function onlistening() {
// Creating client and connecting it to server // Creating client and connecting it to server
// //
tls tls
.connect(common.PORT, { rejectUnauthorized: false }) .connect(server.address().port, { rejectUnauthorized: false })
.on('secureConnect', common.mustCall(onsecureConnect)); .on('secureConnect', common.mustCall(onsecureConnect));
const as = hooks.activitiesOfTypes('TLSWRAP'); const as = hooks.activitiesOfTypes('TLSWRAP');

Loading…
Cancel
Save