From 1e9ad1f6a4d79f111d55cbaa8dcd8d67ba2318cc Mon Sep 17 00:00:00 2001 From: Eugene Girshov Date: Wed, 6 Nov 2013 18:46:38 +0200 Subject: test: fix http backpressure test case - use socket timeout event, - pause socket from the client side. --- test/simple/test-http-pipeline-flood.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/simple/test-http-pipeline-flood.js b/test/simple/test-http-pipeline-flood.js index 901f79f1e..17f872a48 100644 --- a/test/simple/test-http-pipeline-flood.js +++ b/test/simple/test-http-pipeline-flood.js @@ -51,10 +51,10 @@ function parent() { // kill the connection after a bit, verifying that the // flood of requests was eventually halted. console.log('got connection'); - setTimeout(function() { + conn.setTimeout(200, function() { gotTimeout = true; conn.destroy(); - }, 200); + }); }); @@ -111,5 +111,8 @@ function child() { function write() { while (false !== conn.write(req, 'ascii')); + // Pause connection to throttle responses (in order to trigger GH-6214, + // the client need to send a lot of requests and don't read responses) + conn.pause(); } } -- cgit v1.2.1