Skip to content

Commit b1d26d8

Browse files
z0alMylesBorins
authored andcommitted
test: remove uses of common.PORT in test-tls-client tests
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. PR-URL: #12461 Ref: #12376 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
1 parent ce3b544 commit b1d26d8

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

test/parallel/test-tls-client-abort.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ const path = require('path');
1414
const cert = fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem'));
1515
const key = fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem'));
1616

17-
const conn = tls.connect({cert: cert, key: key, port: common.PORT}, function() {
18-
assert.ok(false); // callback should never be executed
19-
});
17+
const conn = tls.connect({cert, key, port: 0}, common.mustNotCall());
2018
conn.on('error', function() {
2119
});
2220
assert.doesNotThrow(function() {

test/parallel/test-tls-client-abort2.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if (!common.hasCrypto) {
88
}
99
const tls = require('tls');
1010

11-
const conn = tls.connect(common.PORT, common.mustNotCall());
11+
const conn = tls.connect(0, common.mustNotCall());
1212
conn.on('error', common.mustCall(function() {
1313
assert.doesNotThrow(function() {
1414
conn.destroy();

0 commit comments

Comments
 (0)