Skip to content

Commit

Permalink
test: kill child in tls-server-verify for speed up
Browse files Browse the repository at this point in the history
For better performance of the test, the parent kills child processes
so as not to wait them to be ended.

Fixes: nodejs#1461
PR-URL: nodejs#1836
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
Shigeki Ohtsu authored and joaocgreis committed Jun 3, 2015
1 parent f3a5f94 commit ededcf5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/parallel/test-tls-server-verify.js
Expand Up @@ -195,15 +195,15 @@ 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;
}

if (!goodbye && /_authed/g.test(out)) {
console.error(prefix + ' * authed');
goodbye = true;
client.stdin.end('goodbye\n');
client.kill();
authed = true;
rejected = false;
}
Expand Down Expand Up @@ -265,6 +265,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() {
Expand Down

0 comments on commit ededcf5

Please sign in to comment.