From 7909c6d46fc3569d9b4c21ac8b2eb863b33eab78 Mon Sep 17 00:00:00 2001 From: Artur Vieira Date: Wed, 10 May 2017 02:02:20 +0000 Subject: [PATCH] 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 Reviewed-By: Colin Ihrig Reviewed-By: Michael Dawson --- test/parallel/test-dgram-send-callback-buffer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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));