Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

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.

(cherry picked from commit 833b236)

Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #25368
  • Loading branch information
Shigeki Ohtsu authored and orangemocha committed Jun 4, 2015
1 parent 83b7c07 commit cb63d93
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/simple/test-tls-server-verify.js
Expand Up @@ -211,15 +211,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 @@ -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() {
Expand Down

0 comments on commit cb63d93

Please sign in to comment.