From 94eed0fb11d733c8d18b174ae9ba71ead3da4ca8 Mon Sep 17 00:00:00 2001 From: Aditya Anand Date: Mon, 17 Apr 2017 17:20:17 +0530 Subject: test: use dynamic port instead of common.PORT Remove common.PORT from, test-net-connect-immediate-destroy, test-net-options-lookup, test-net-connect-local-error, test-net-connect-handle-econnrefused, test-net-socket-destroy-twice, test-net-better-error-messages-port-hostname, test-net-localerror, to reduce possibility that a dynamic port used in another test will collide with common.PORT. Moved test-net-listen-shared-ports, test-net-better-error-messages-port from tests/parallel to test/sequential Refs: https://github.com/nodejs/node/issues/12376 PR-URL: https://github.com/nodejs/node/pull/12473 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Yuta Hiroto Reviewed-By: Santiago Gimeno Reviewed-By: Sakthipriyan Vairamani --- test/parallel/test-net-connect-immediate-destroy.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test/parallel/test-net-connect-immediate-destroy.js') diff --git a/test/parallel/test-net-connect-immediate-destroy.js b/test/parallel/test-net-connect-immediate-destroy.js index 9a029b5d60..3ca58c356b 100644 --- a/test/parallel/test-net-connect-immediate-destroy.js +++ b/test/parallel/test-net-connect-immediate-destroy.js @@ -2,7 +2,10 @@ const common = require('../common'); const net = require('net'); -const socket = net.connect(common.PORT, common.localhostIPv4, - common.mustNotCall()); +const server = net.createServer(); +server.listen(0); +const port = server.address().port; +const socket = net.connect(port, common.localhostIPv4, common.mustNotCall()); socket.on('error', common.mustNotCall()); +server.close(); socket.destroy(); -- cgit v1.2.1