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

Commit cb63d93

Browse files
Shigeki Ohtsuorangemocha
authored andcommitted
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. (cherry picked from commit 833b236) Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: #25368
1 parent 83b7c07 commit cb63d93

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/simple/test-tls-server-verify.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,15 +211,15 @@ function runClient(prefix, port, options, cb) {
211211
if (!goodbye && /_unauthed/g.test(out)) {
212212
console.error(prefix + ' * unauthed');
213213
goodbye = true;
214-
client.stdin.end('goodbye\n');
214+
client.kill();
215215
authed = false;
216216
rejected = false;
217217
}
218218

219219
if (!goodbye && /_authed/g.test(out)) {
220220
console.error(prefix + ' * authed');
221221
goodbye = true;
222-
client.stdin.end('goodbye\n');
222+
client.kill();
223223
authed = true;
224224
rejected = false;
225225
}
@@ -281,6 +281,12 @@ function runTest(port, testIndex) {
281281

282282
var renegotiated = false;
283283
var server = tls.Server(serverOptions, function handleConnection(c) {
284+
c.on('error', function(e) {
285+
// child.kill() leads ECONNRESET errro in the TLS connection of
286+
// openssl s_client via spawn(). A Test result is already
287+
// checked by the data of client.stdout before child.kill() so
288+
// these tls errors can be ignored.
289+
});
284290
if (tcase.renegotiate && !renegotiated) {
285291
renegotiated = true;
286292
setTimeout(function() {

0 commit comments

Comments
 (0)