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: https://github.com/nodejs/io.js/issues/1461 PR-URL: https://github.com/nodejs/io.js/pull/1836 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
parent
e6ccdcc1fe
commit
4cf323d23d
@ -195,7 +195,7 @@ function runClient(prefix, port, options, cb) {
|
|||||||
if (!goodbye && /_unauthed/g.test(out)) {
|
if (!goodbye && /_unauthed/g.test(out)) {
|
||||||
console.error(prefix + ' * unauthed');
|
console.error(prefix + ' * unauthed');
|
||||||
goodbye = true;
|
goodbye = true;
|
||||||
client.stdin.end('goodbye\n');
|
client.kill();
|
||||||
authed = false;
|
authed = false;
|
||||||
rejected = false;
|
rejected = false;
|
||||||
}
|
}
|
||||||
@ -203,7 +203,7 @@ function runClient(prefix, port, options, cb) {
|
|||||||
if (!goodbye && /_authed/g.test(out)) {
|
if (!goodbye && /_authed/g.test(out)) {
|
||||||
console.error(prefix + ' * authed');
|
console.error(prefix + ' * authed');
|
||||||
goodbye = true;
|
goodbye = true;
|
||||||
client.stdin.end('goodbye\n');
|
client.kill();
|
||||||
authed = true;
|
authed = true;
|
||||||
rejected = false;
|
rejected = false;
|
||||||
}
|
}
|
||||||
@ -265,6 +265,12 @@ function runTest(port, testIndex) {
|
|||||||
|
|
||||||
var renegotiated = false;
|
var renegotiated = false;
|
||||||
var server = tls.Server(serverOptions, function handleConnection(c) {
|
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) {
|
if (tcase.renegotiate && !renegotiated) {
|
||||||
renegotiated = true;
|
renegotiated = true;
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user