From 833b23636045f7afc929196139021630a390391a Mon Sep 17 00:00:00 2001 From: Shigeki Ohtsu Date: Wed, 27 May 2015 10:16:51 +0900 Subject: [PATCH] test: kill child in tls-server-verify for speed up For better performance of the test, the parent kills child processes so as not to wait them to be ended. --- test/simple/test-tls-server-verify.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/simple/test-tls-server-verify.js b/test/simple/test-tls-server-verify.js index 9375026dfca..ec8623c8e9d 100644 --- a/test/simple/test-tls-server-verify.js +++ b/test/simple/test-tls-server-verify.js @@ -211,7 +211,7 @@ function runClient(prefix, port, options, cb) { if (!goodbye && /_unauthed/g.test(out)) { console.error(prefix + ' * unauthed'); goodbye = true; - client.stdin.end('goodbye\n'); + client.kill(); authed = false; rejected = false; } @@ -219,7 +219,7 @@ function runClient(prefix, port, options, cb) { if (!goodbye && /_authed/g.test(out)) { console.error(prefix + ' * authed'); goodbye = true; - client.stdin.end('goodbye\n'); + client.kill(); authed = true; rejected = false; } @@ -281,6 +281,12 @@ function runTest(port, testIndex) { var renegotiated = false; var server = tls.Server(serverOptions, function handleConnection(c) { + c.on('error', function(e) { + // child.kill() leads ECONNRESET errro in the TLS connection of + // openssl s_client via spawn(). A Test result is already + // checked by the data of client.stdout before child.kill() so + // these tls errors can be ignored. + }); if (tcase.renegotiate && !renegotiated) { renegotiated = true; setTimeout(function() {