Skip to content

Commit a515ebc

Browse files
committed
test: refactor test-async-wrap-getasyncid
So it does not use `common.PORT` anymore.
1 parent 472cde6 commit a515ebc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/sequential/test-async-wrap-getasyncid.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,11 @@ if (common.hasCrypto) { // eslint-disable-line crypto-check
301301
testInitialized(handle, 'UDP');
302302
testUninitialized(req, 'SendWrap');
303303

304-
handle.bind('0.0.0.0', common.PORT, undefined);
304+
handle.bind('0.0.0.0', 0, undefined);
305+
const addr = {};
306+
handle.getsockname(addr);
305307
req.address = '127.0.0.1';
306-
req.port = common.PORT;
308+
req.port = addr.port;
307309
req.oncomplete = () => handle.close();
308310
handle.send(req, [Buffer.alloc(1)], 1, req.port, req.address, true);
309311
testInitialized(req, 'SendWrap');

0 commit comments

Comments
 (0)