Skip to content

Commit d7b657f

Browse files
santigimenoMylesBorins
authored andcommitted
test: refactor test-async-wrap-getasyncid
So it does not use `common.PORT` anymore. PR-URL: #18727 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]>
1 parent 905c350 commit d7b657f

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
@@ -280,9 +280,11 @@ if (common.hasCrypto) { // eslint-disable-line crypto-check
280280
testInitialized(handle, 'UDP');
281281
testUninitialized(req, 'SendWrap');
282282

283-
handle.bind('0.0.0.0', common.PORT, undefined);
283+
handle.bind('0.0.0.0', 0, undefined);
284+
const addr = {};
285+
handle.getsockname(addr);
284286
req.address = '127.0.0.1';
285-
req.port = common.PORT;
287+
req.port = addr.port;
286288
req.oncomplete = () => handle.close();
287289
handle.send(req, [Buffer.alloc(1)], 1, req.port, req.address, true);
288290
testInitialized(req, 'SendWrap');

0 commit comments

Comments
 (0)