diff options
author | Rich Trott <rtrott@gmail.com> | 2017-06-11 21:10:56 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2017-06-12 16:21:06 -0700 |
commit | b71d67795a1366b2c9e77e4156e661df456d3660 (patch) | |
tree | bf98ebcacb5e6bb4355be784920bf48a3bcf431f /test/parallel/test-child-process-stdio-big-write-end.js | |
parent | 27cc30aea849ad26d0aaaa48db57b1299d047c90 (diff) | |
download | android-node-v8-b71d67795a1366b2c9e77e4156e661df456d3660.tar.gz android-node-v8-b71d67795a1366b2c9e77e4156e661df456d3660.tar.bz2 android-node-v8-b71d67795a1366b2c9e77e4156e661df456d3660.zip |
test: increase bufsize in child process write test
test-child-process-stdio-big-write-end was failing on ubuntu1604-arm64
because the while loop that was supposed to fill up the buffer ended up
being an infinite loop.
This increases the size of the writes in the loop by 1K until the buffer
fills up.
PR-URL: https://github.com/nodejs/node/pull/13626
Fixes: https://github.com/nodejs/node/issues/13603
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'test/parallel/test-child-process-stdio-big-write-end.js')
-rw-r--r-- | test/parallel/test-child-process-stdio-big-write-end.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/parallel/test-child-process-stdio-big-write-end.js b/test/parallel/test-child-process-stdio-big-write-end.js index 6cc3d86644..2d9234fd48 100644 --- a/test/parallel/test-child-process-stdio-big-write-end.js +++ b/test/parallel/test-child-process-stdio-big-write-end.js @@ -22,7 +22,7 @@ 'use strict'; require('../common'); const assert = require('assert'); -const BUFSIZE = 1024; +let bufsize = 0; switch (process.argv[2]) { case undefined: @@ -51,14 +51,15 @@ function parent() { // Write until the buffer fills up. let buf; do { - buf = Buffer.alloc(BUFSIZE, '.'); - sent += BUFSIZE; + bufsize += 1024; + buf = Buffer.alloc(bufsize, '.'); + sent += bufsize; } while (child.stdin.write(buf)); // then write a bunch more times. for (let i = 0; i < 100; i++) { - const buf = Buffer.alloc(BUFSIZE, '.'); - sent += BUFSIZE; + const buf = Buffer.alloc(bufsize, '.'); + sent += bufsize; child.stdin.write(buf); } |