From b27e3c8b898ba13d658aa3a9db710bf0bbaaab3e Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 20 Jan 2019 16:38:39 -0800 Subject: [PATCH] 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 Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig --- test/pummel/test-https-ci-reneg-attack.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/pummel/test-https-ci-reneg-attack.js b/test/pummel/test-https-ci-reneg-attack.js index 9411d24e077097..2749629303b979 100644 --- a/test/pummel/test-https-ci-reneg-attack.js +++ b/test/pummel/test-https-ci-reneg-attack.js @@ -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();