From ef9139e5a0c1d7b75a3675e70a8c71eabe11e216 Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Fri, 1 Feb 2019 12:00:01 -0800 Subject: [PATCH] test: end tls gracefully, rather than destroy The timing of destroy between client/server is undefined, but end is guaranteed to occur. PR-URL: https://github.com/nodejs/node/pull/25508 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- test/parallel/test-tls-sni-option.js | 2 +- test/parallel/test-tls-sni-server-client.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-tls-sni-option.js b/test/parallel/test-tls-sni-option.js index 375575c78ab635..3a6a231b477f5d 100644 --- a/test/parallel/test-tls-sni-option.js +++ b/test/parallel/test-tls-sni-option.js @@ -115,6 +115,7 @@ let clientError; const server = tls.createServer(serverOptions, function(c) { serverResults.push({ sni: c.servername, authorized: c.authorized }); + c.end(); }); server.on('tlsClientError', function(err) { @@ -135,7 +136,6 @@ function startTest() { clientResults.push( client.authorizationError && (client.authorizationError === 'ERR_TLS_CERT_ALTNAME_INVALID')); - client.destroy(); next(); }); diff --git a/test/parallel/test-tls-sni-server-client.js b/test/parallel/test-tls-sni-server-client.js index 073e95988a3a08..8ab025667ea68a 100644 --- a/test/parallel/test-tls-sni-server-client.js +++ b/test/parallel/test-tls-sni-server-client.js @@ -86,6 +86,7 @@ const clientResults = []; const server = tls.createServer(serverOptions, function(c) { serverResults.push(c.servername); + c.end(); }); server.addContext('a.example.com', SNIContexts['a.example.com']); @@ -107,7 +108,6 @@ function startTest() { clientResults.push( client.authorizationError && (client.authorizationError === 'ERR_TLS_CERT_ALTNAME_INVALID')); - client.destroy(); // Continue start();