Skip to content

Commit

Permalink
test: remove uses of common.PORT in test-tls-client tests
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
z0al authored and evanlucas committed May 2, 2017
1 parent 13441eb commit ddc3528
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/parallel/test-tls-client-abort.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,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() {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-tls-client-abort2.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,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();
Expand Down

0 comments on commit ddc3528

Please sign in to comment.