From 8a4f3b7dfc59a4bcb759d9898fea6b9220f3ece2 Mon Sep 17 00:00:00 2001 From: Artur Vieira Date: Wed, 10 May 2017 02:26:50 +0000 Subject: [PATCH] test: bind to 0 in dgram-send-callback-buffer-length Remove common.PORT from test-dgram-send-callback-buffer-length to eliminate possibility that a dynamic port used in another test will collide with common.PORT. PR-URL: https://github.com/nodejs/node/pull/12943 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-length.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-dgram-send-callback-buffer-length.js b/test/parallel/test-dgram-send-callback-buffer-length.js index f409d2666386c4..bf1b351df33e7b 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));