Skip to content

Commit

Permalink
test: fix flaky test-http-highwatermark
Browse files Browse the repository at this point in the history
PR-URL: #17949
Fixes: #17857
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
apapirovski authored and MylesBorins committed Jan 9, 2018
1 parent 5ad797f commit d4e5ace
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let requestReceived = 0;
const server = http.createServer(function(req, res) {
const id = ++requestReceived;
const enoughToDrain = req.connection.writableHighWaterMark;
const body = 'x'.repeat(enoughToDrain);
const body = 'x'.repeat(enoughToDrain * 100);

if (id === 1) {
// Case of needParse = false
Expand All @@ -39,11 +39,11 @@ const server = http.createServer(function(req, res) {
}).on('listening', () => {
const c = net.createConnection(server.address().port, () => {
c.write('GET / HTTP/1.1\r\n\r\n');
c.write('GET / HTTP/1.1\r\n\r\n');
c.write('GET / HTTP/1.1\r\n\r\n',
() => setImmediate(() => c.resume()));
c.end();
});

c.on('data', () => {});
c.on('end', () => {
server.close();
});
Expand Down

0 comments on commit d4e5ace

Please sign in to comment.