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.
  • Loading branch information
Shigeki Ohtsu committed Jun 1, 2015
1 parent a60b7f0 commit 833b236
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/simple/test-tls-server-verify.js
Original file line number Diff line number Diff line change
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 833b236

Please sign in to comment.