From d7b657fceb0947d1b9099f94f7686e1ee76a213b Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Mon, 12 Feb 2018 10:14:50 +0100 Subject: [PATCH] test: refactor test-async-wrap-getasyncid So it does not use `common.PORT` anymore. PR-URL: https://github.com/nodejs/node/pull/18727 Reviewed-By: Ruben Bridgewater Reviewed-By: Anatoli Papirovski --- test/sequential/test-async-wrap-getasyncid.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/sequential/test-async-wrap-getasyncid.js b/test/sequential/test-async-wrap-getasyncid.js index 16e235b97e2119..760f016668139a 100644 --- a/test/sequential/test-async-wrap-getasyncid.js +++ b/test/sequential/test-async-wrap-getasyncid.js @@ -280,9 +280,11 @@ if (common.hasCrypto) { // eslint-disable-line crypto-check testInitialized(handle, 'UDP'); testUninitialized(req, 'SendWrap'); - handle.bind('0.0.0.0', common.PORT, undefined); + handle.bind('0.0.0.0', 0, undefined); + const addr = {}; + handle.getsockname(addr); req.address = '127.0.0.1'; - req.port = common.PORT; + req.port = addr.port; req.oncomplete = () => handle.close(); handle.send(req, [Buffer.alloc(1)], 1, req.port, req.address, true); testInitialized(req, 'SendWrap');