From 9f20d29e06aab577f620db55813fd04c08c1208d Mon Sep 17 00:00:00 2001 From: Gibson Fahnestock Date: Fri, 26 Feb 2016 12:25:53 +0000 Subject: [PATCH] test: fix flaky tls-inception The test now catches ECONNRESET errors thrown in parallel/test-tls-inception on windows. --- test/parallel/test-tls-inception.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-tls-inception.js b/test/parallel/test-tls-inception.js index 8946f52bdd63..ea1372455d00 100644 --- a/test/parallel/test-tls-inception.js +++ b/test/parallel/test-tls-inception.js @@ -32,8 +32,15 @@ a = tls.createServer(options, function(socket) { dest.pipe(socket); socket.pipe(dest); + if (common.isWindows) { + socket.on('error', function(err) { + if (err.code !== 'ECONNRESET') + throw err; + }); + } + dest.on('end', function() { - socket.destroy(); + socket.end(); }); });