diff options
author | Eugene Girshov <eugene.girshov@nixu.com> | 2013-11-06 18:46:38 +0200 |
---|---|---|
committer | Fedor Indutny <fedor.indutny@gmail.com> | 2013-11-07 12:30:22 +0400 |
commit | 1e9ad1f6a4d79f111d55cbaa8dcd8d67ba2318cc (patch) | |
tree | e1391089a3e5828c3ed35a2a7c68b279fffd2751 | |
parent | 532f9ffca2d9ac01e92a15a46adc0374ef75f4c4 (diff) | |
download | node-1e9ad1f6a4d79f111d55cbaa8dcd8d67ba2318cc.tar.gz |
test: fix http backpressure test case
- use socket timeout event,
- pause socket from the client side.
-rw-r--r-- | test/simple/test-http-pipeline-flood.js | 7 |
1 files 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(); } } |