summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnatoli Papirovski <apapirovski@mac.com>2018-01-02 11:45:21 -0500
committerRuben Bridgewater <ruben@bridgewater.de>2018-01-05 02:14:12 +0100
commita51944da0aeae65676a928c9473965c453e0e028 (patch)
tree9fa732f03924747730ab4a361d4eaa90b8ff5d98 /test
parent189d29f39e6de9ccf10682bfd1341819b4a2291f (diff)
downloadandroid-node-v8-a51944da0aeae65676a928c9473965c453e0e028.tar.gz
android-node-v8-a51944da0aeae65676a928c9473965c453e0e028.tar.bz2
android-node-v8-a51944da0aeae65676a928c9473965c453e0e028.zip
test: fix flaky test-http-highwatermark
PR-URL: https://github.com/nodejs/node/pull/17949 Fixes: https://github.com/nodejs/node/issues/17857 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-http-highwatermark.js (renamed from test/parallel/test-http-hightwatermark.js)6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/parallel/test-http-hightwatermark.js b/test/parallel/test-http-highwatermark.js
index b2432227a9..79d9c46a55 100644
--- a/test/parallel/test-http-hightwatermark.js
+++ b/test/parallel/test-http-highwatermark.js
@@ -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
@@ -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();
});