test: use dynamic port in test-dgram-send-callback-buffer

Replace common.PORT with available port assigned by the operating
system in test-dgram-send-callback-buffer.

PR-URL: https://github.com/nodejs/node/pull/12942
Refs: https://github.com/nodejs/node/issues/12376
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <mhdawson@ibm.com>
This commit is contained in:
Artur Vieira 2017-05-10 02:02:20 +00:00 committed by Luigi Pinca
parent 4c847347c3
commit e00116d2c4

View File

@ -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));