test: fix test-tls-zero-clear-in flakiness
authorSantiago Gimeno <santiago.gimeno@gmail.com>
Tue, 26 Jan 2016 23:44:36 +0000 (00:44 +0100)
committerMyles Borins <mborins@us.ibm.com>
Wed, 2 Mar 2016 22:01:11 +0000 (14:01 -0800)
It can happen that the server-side socket is destroyed before the
client-side socket has gracefully closed, thus causing a 'ECONNRESET'
error in this socket. To solve this, also close gracefully in the server
side too.

PR-URL: https://github.com/nodejs/node/pull/4888
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
test/parallel/test-tls-zero-clear-in.js

index 33db08a..652d6d1 100644 (file)
@@ -22,7 +22,7 @@ var server = tls.createServer({
 }, function(c) {
   // Nop
   setTimeout(function() {
-    c.destroy();
+    c.end();
     server.close();
   }, 20);
 }).listen(common.PORT, function() {