mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
test: fix http backpressure test case
- use socket timeout event, - pause socket from the client side.
This commit is contained in:
1 parent
532f9ffca2
commit
1e9ad1f6a4
1 file changed
+5
-2
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user