mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
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: https://github.com/nodejs/node/pull/12461 Ref: https://github.com/nodejs/node/issues/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>
This commit is contained in:
1 parent
13441eb1e1
commit
ddc35282c0
2 files changed
+2
-2
No files matched your search
@@ -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() {
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user