From ddbf07ab89b501e0ee41c69655920757fb561ca0 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 2 Oct 2017 14:37:32 -0700 Subject: [PATCH] test: remove `common.PORT` from test-tlswrap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `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 Reviewed-By: Tobias Nießen Reviewed-By: Refael Ackermann Reviewed-By: Yuta Hiroto Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- test/async-hooks/test-tlswrap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/async-hooks/test-tlswrap.js b/test/async-hooks/test-tlswrap.js index 3876b860ca876a..7d92b603f3e18a 100644 --- a/test/async-hooks/test-tlswrap.js +++ b/test/async-hooks/test-tlswrap.js @@ -25,7 +25,7 @@ const server = tls }) .on('listening', common.mustCall(onlistening)) .on('secureConnection', common.mustCall(onsecureConnection)) - .listen(common.PORT); + .listen(0); let svr, client; function onlistening() { @@ -33,7 +33,7 @@ function onlistening() { // Creating client and connecting it to server // tls - .connect(common.PORT, { rejectUnauthorized: false }) + .connect(server.address().port, { rejectUnauthorized: false }) .on('secureConnect', common.mustCall(onsecureConnect)); const as = hooks.activitiesOfTypes('TLSWRAP');