From 60e396c3caabaf1f789bab33d19df83dece23c59 Mon Sep 17 00:00:00 2001 From: Ahmed Taj elsir Date: Mon, 17 Apr 2017 14:23:21 +0300 Subject: [PATCH 1/2] test: change common.PORT to '0' in test/parallel/test-tls-client-abort Change common.PORT to '0' to avoid the possibility of getting EADDRINUSE error if another test in 'parallel' uses port '0' at the same time. --- test/parallel/test-tls-client-abort.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-tls-client-abort.js b/test/parallel/test-tls-client-abort.js index ef9d28c9f12369..15928a04f67876 100644 --- a/test/parallel/test-tls-client-abort.js +++ b/test/parallel/test-tls-client-abort.js @@ -35,7 +35,7 @@ const path = require('path'); const cert = fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem')); const key = fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')); -const conn = tls.connect({cert, key, port: common.PORT}, common.mustNotCall()); +const conn = tls.connect({cert, key, port: 0}, common.mustNotCall()); conn.on('error', function() { }); assert.doesNotThrow(function() { From e6a9f58d93c80d63fd38a711dc6e7df7e143455f Mon Sep 17 00:00:00 2001 From: Ahmed Taj elsir Date: Mon, 17 Apr 2017 14:34:31 +0300 Subject: [PATCH 2/2] test: use '0' as port in test-tls-client-abort2 Remove common.PORT in test-tls-client-abort2 and replace it with '0' to eliminate EADDRINUSE errors. Refs: nodejs#12376 --- test/parallel/test-tls-client-abort2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-tls-client-abort2.js b/test/parallel/test-tls-client-abort2.js index 0656fd0e0f9a81..a652edfa8fe389 100644 --- a/test/parallel/test-tls-client-abort2.js +++ b/test/parallel/test-tls-client-abort2.js @@ -29,7 +29,7 @@ if (!common.hasCrypto) { } const tls = require('tls'); -const conn = tls.connect(common.PORT, common.mustNotCall()); +const conn = tls.connect(0, common.mustNotCall()); conn.on('error', common.mustCall(function() { assert.doesNotThrow(function() { conn.destroy();