From b40c86dfd6784fa12d16daa91e1b6a5f07dc6cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Reis?= Date: Fri, 22 May 2015 14:16:07 +0100 Subject: [PATCH] test: running tls-server-verify clients in parallel OpenSSL s_client introduces some delay on Windows. With all clients running sequentially, this delay is big enough to break CI. This fix runs the clients in parallel (unless the test includes renegotiation), reducing the total run time. Fixes: https://github.com/nodejs/io.js/issues/1461 PR-URL: https://github.com/nodejs/io.js/pull/1836 Reviewed-By: Ben Noordhuis --- test/parallel/test-tls-server-verify.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-tls-server-verify.js b/test/parallel/test-tls-server-verify.js index f30134f04ac0a5..2db47d32d835fb 100644 --- a/test/parallel/test-tls-server-verify.js +++ b/test/parallel/test-tls-server-verify.js @@ -307,7 +307,21 @@ function runTest(testIndex) { if (tcase.debug) { console.error('TLS server running on port ' + common.PORT); } else { - runNextClient(0); + if (tcase.renegotiate) { + runNextClient(0); + } else { + var clientsCompleted = 0; + for (var i = 0; i < tcase.clients.length; i++) { + runClient(tcase.clients[i], function() { + clientsCompleted++; + if (clientsCompleted === tcase.clients.length) { + server.close(); + successfulTests++; + runTest(testIndex + 1); + } + }); + } + } } }); }