test: fix tls-honorcipherorder slowness
authorFedor Indutny <fedor.indutny@gmail.com>
Sat, 15 Feb 2014 11:56:37 +0000 (15:56 +0400)
committerFedor Indutny <fedor.indutny@gmail.com>
Sat, 15 Feb 2014 21:19:54 +0000 (01:19 +0400)
End accepted stream to prevent client fd from hanging in FIN_WAIT_1
state. The 30 second delay was caused by default non-zero SO_LINGER.

test/simple/test-tls-honorcipherorder.js

index 69ea946..dac13d7 100644 (file)
@@ -44,6 +44,10 @@ function test(honorCipherOrder, clientCipher, expectedCipher, cb) {
 
   var server = tls.createServer(soptions, function(cleartextStream) {
     nconns++;
+
+    // End socket to send CLOSE_NOTIFY and TCP FIN packet, otherwise
+    // it may hang for ~30 seconds in FIN_WAIT_1 state (at least on OSX).
+    cleartextStream.end();
   });
   server.listen(common.PORT, localhost, function() {
     var coptions = {