diff --git a/test/parallel/test-dgram-send-callback-buffer-length.js b/test/parallel/test-dgram-send-callback-buffer-length.js index f409d26663..bf1b351df3 100644 --- a/test/parallel/test-dgram-send-callback-buffer-length.js +++ b/test/parallel/test-dgram-send-callback-buffer-length.js @@ -38,4 +38,7 @@ const messageSent = common.mustCall(function messageSent(err, bytes) { client.close(); }); -client.send(buf, offset, len, common.PORT, '127.0.0.1', messageSent); +client.bind(0, () => client.send(buf, offset, len, + client.address().port, + '127.0.0.1', + messageSent));