test: replace common.PORT with 0 in https renegotiation test

Repeated use of common.PORT was resulting in sporadic failures on some
operating systems.

PR-URL: https://github.com/nodejs/node/pull/25599
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Rich Trott 2019-01-20 16:38:39 -08:00
parent e3f917ef65
commit c33d38b449

View File

@ -65,8 +65,9 @@ function test(next) {
res.end('ok');
});
server.listen(common.PORT, function() {
const args = (`s_client -connect 127.0.0.1:${common.PORT}`).split(' ');
server.listen(0, function() {
const cmd = `s_client -connect 127.0.0.1:${server.address().port}`;
const args = cmd.split(' ');
const child = spawn(common.opensslCli, args);
child.stdout.resume();