Skip to content

Commit 4cf323d

Browse files
Shigeki Ohtsuorangemocha
Shigeki Ohtsu
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. Fixes: #1461 PR-URL: #1836 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent e6ccdcc commit 4cf323d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

+8-2
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,15 @@ function runClient(prefix, port, options, cb) {
195195
if (!goodbye && /_unauthed/g.test(out)) {
196196
console.error(prefix + ' * unauthed');
197197
goodbye = true;
198-
client.stdin.end('goodbye\n');
198+
client.kill();
199199
authed = false;
200200
rejected = false;
201201
}
202202

203203
if (!goodbye && /_authed/g.test(out)) {
204204
console.error(prefix + ' * authed');
205205
goodbye = true;
206-
client.stdin.end('goodbye\n');
206+
client.kill();
207207
authed = true;
208208
rejected = false;
209209
}
@@ -265,6 +265,12 @@ function runTest(port, testIndex) {
265265

266266
var renegotiated = false;
267267
var server = tls.Server(serverOptions, function handleConnection(c) {
268+
c.on('error', function(e) {
269+
// child.kill() leads ECONNRESET errro in the TLS connection of
270+
// openssl s_client via spawn(). A Test result is already
271+
// checked by the data of client.stdout before child.kill() so
272+
// these tls errors can be ignored.
273+
});
268274
if (tcase.renegotiate && !renegotiated) {
269275
renegotiated = true;
270276
setTimeout(function() {

0 commit comments

Comments
 (0)