diff --git a/test/parallel/test-dgram-send-callback-buffer.js b/test/parallel/test-dgram-send-callback-buffer.js index e0b2a581bf74aa..c174e585d61282 100644 --- a/test/parallel/test-dgram-send-callback-buffer.js +++ b/test/parallel/test-dgram-send-callback-buffer.js @@ -14,4 +14,7 @@ const onMessage = common.mustCall(function(err, bytes) { client.close(); }); -client.send(buf, common.PORT, common.localhostIPv4, onMessage); +client.bind(0, () => client.send(buf, + client.address().port, + common.localhostIPv4, + onMessage));