test: fix http backpressure test case

- use socket timeout event,
- pause socket from the client side.
This commit is contained in:
Eugene Girshov authored and Fedor Indutny committed 2013-11-07 12:30:22 +04:00
1 parent 532f9ffca2
commit 1e9ad1f6a4
1 file changed
+5 -2
+5 -2
View File
@@ -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();
}
}