Skip to content

Commit 4afa748

Browse files
Trottaddaleax
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 8cb7d96 commit 4afa748

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

+6-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
'use strict';
2323
require('../common');
2424
const assert = require('assert');
25-
const BUFSIZE = 1024;
25+
let bufsize = 0;
2626

2727
switch (process.argv[2]) {
2828
case undefined:
@@ -51,14 +51,15 @@ function parent() {
5151
// Write until the buffer fills up.
5252
let buf;
5353
do {
54-
buf = Buffer.alloc(BUFSIZE, '.');
55-
sent += BUFSIZE;
54+
bufsize += 1024;
55+
buf = Buffer.alloc(bufsize, '.');
56+
sent += bufsize;
5657
} while (child.stdin.write(buf));
5758

5859
// then write a bunch more times.
5960
for (let i = 0; i < 100; i++) {
60-
const buf = Buffer.alloc(BUFSIZE, '.');
61-
sent += BUFSIZE;
61+
const buf = Buffer.alloc(bufsize, '.');
62+
sent += bufsize;
6263
child.stdin.write(buf);
6364
}
6465

0 commit comments

Comments
 (0)