Skip to content

Commit ddc3528

Browse files
z0alevanlucas
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 <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]>
1 parent 13441eb commit ddc3528

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +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, key, port: common.PORT}, common.mustNotCall());
17+
const conn = tls.connect({cert, key, port: 0}, common.mustNotCall());
1818
conn.on('error', function() {
1919
});
2020
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)