Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Sporadic Failure on Linux: test/simple/test-tls-pause.js #4800

Closed
isaacs opened this issue Feb 19, 2013 · 0 comments
Closed

Sporadic Failure on Linux: test/simple/test-tls-pause.js #4800

isaacs opened this issue Feb 19, 2013 · 0 comments
Assignees
Labels
Milestone

Comments

@isaacs
Copy link

isaacs commented Feb 19, 2013

It looks like the server's socket isn't emitting drain, and the whole system just gets clogged up. Running this will usually end up locking for me:

for i in `seq 5`; do ./node test/simple/test-tls-pause.js || break; done

Making this modification to the test makes it pass:

From a145087d43953142b100a71ed59a043204afd95f Mon Sep 17 00:00:00 2001
From: isaacs <i@izs.me>
Date: Mon, 18 Feb 2013 20:20:48 -0800
Subject: [PATCH] HACK: forcibly emit drain in simple/test-tls-pause

---
 test/simple/test-tls-pause.js |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/test/simple/test-tls-pause.js b/test/simple/test-tls-pause.js
index 5eaac8d..1e44f47 100644
--- a/test/simple/test-tls-pause.js
+++ b/test/simple/test-tls-pause.js
@@ -44,6 +44,13 @@ var server = tls.Server(options, function(socket) {
   socket.on('data', function(c) {
     console.error('data', c.length);
   });
+  socket.on('end', function() {
+    clearTimeout(timeout);
+  });
+  var timeout = setInterval(function() {
+    console.error('SERVER timeout', socket._writableState, socket._readableState);
+    socket.emit('drain');
+  }, 1000);
 });

 server.listen(common.PORT, function() {
-- 
1.7.0.4

but of course, that's just covering up the problem, not really fixing it.

Passes 100% of the time on Darwin and SmartOS.

@ghost ghost assigned indutny Feb 19, 2013
@isaacs isaacs closed this as completed in 60238cc Feb 19, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants