Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup
  • Loading branch information
Trott committed Jan 24, 2016
commit a94ea4c44f216bf56daa7e545c37f31c3030607e
11 changes: 9 additions & 2 deletions test/parallel/test-http-pipeline-flood.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const assert = require('assert');
// Normally when the writable stream emits a 'drain' event, the server then
// uncorks the readable stream, although we arent testing that part here.

// The issue being tested exists in Node.js 0.10.20 and is resolved in 0.10.21
// and newer.

switch (process.argv[2]) {
case undefined:
return parent();
Expand Down Expand Up @@ -59,7 +62,7 @@ function parent() {
server.close();
}));

server.setTimeout(common.platformTimeout(200), common.mustCall(function() {
server.setTimeout(common.platformTimeout(10), common.mustCall(function() {
child.kill();
}));
});
Expand All @@ -79,7 +82,11 @@ function child() {

req = new Array(10241).join(req);

conn.on('connect', write);
conn.on('connect', function() {
// Terminate child after flooding.
setTimeout(function() { conn.destroy(); }, 500);
write();
});

conn.on('drain', write);

Expand Down