Skip to content

Commit 9e9a9c3

Browse files
TrottMylesBorins
authored andcommitted
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: #13626 Fixes: #13603 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent c97b167 commit 9e9a9c3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/parallel/test-child-process-stdio-big-write-end.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
require('../common');
33
const assert = require('assert');
4-
const BUFSIZE = 1024;
4+
let bufsize = 0;
55

66
switch (process.argv[2]) {
77
case undefined:
@@ -30,14 +30,15 @@ function parent() {
3030
// Write until the buffer fills up.
3131
let buf;
3232
do {
33-
buf = Buffer.alloc(BUFSIZE, '.');
34-
sent += BUFSIZE;
33+
bufsize += 1024;
34+
buf = Buffer.alloc(bufsize, '.');
35+
sent += bufsize;
3536
} while (child.stdin.write(buf));
3637

3738
// then write a bunch more times.
3839
for (let i = 0; i < 100; i++) {
39-
const buf = Buffer.alloc(BUFSIZE, '.');
40-
sent += BUFSIZE;
40+
const buf = Buffer.alloc(bufsize, '.');
41+
sent += bufsize;
4142
child.stdin.write(buf);
4243
}
4344

0 commit comments

Comments
 (0)