Skip to content

Commit 825d390

Browse files
z0aljasnell
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 6a1275d commit 825d390

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const path = require('path');
3535
const cert = fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem'));
3636
const key = fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem'));
3737

38-
const conn = tls.connect({cert, key, port: common.PORT}, common.mustNotCall());
38+
const conn = tls.connect({cert, key, port: 0}, common.mustNotCall());
3939
conn.on('error', function() {
4040
});
4141
assert.doesNotThrow(function() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if (!common.hasCrypto) {
2929
}
3030
const tls = require('tls');
3131

32-
const conn = tls.connect(common.PORT, common.mustNotCall());
32+
const conn = tls.connect(0, common.mustNotCall());
3333
conn.on('error', common.mustCall(function() {
3434
assert.doesNotThrow(function() {
3535
conn.destroy();

0 commit comments

Comments
 (0)