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: #1461
PR-URL: #1836
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
Shigeki Ohtsu authored and orangemocha committed Jun 3, 2015
1 parent e6ccdcc commit 4cf323d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/parallel/test-tls-server-verify.js
Original file line number Diff line number Diff line change
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 4cf323d

Please sign in to comment.