diff --git a/test/sequential/test-async-wrap-getasyncid.js b/test/sequential/test-async-wrap-getasyncid.js index bb0ad3d0ef4bd3..66eaabec25d977 100644 --- a/test/sequential/test-async-wrap-getasyncid.js +++ b/test/sequential/test-async-wrap-getasyncid.js @@ -267,9 +267,11 @@ if (common.hasCrypto) { // eslint-disable-line node-core/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');