Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: share maxBuffer between stdout and stderr #4035

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion test/parallel/test-child-process-spawnsync-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,11 @@ assert.ok(ret.error, 'maxBuffer should error');
assert.strictEqual(ret.error.errno, 'ENOBUFS');
// we can have buffers larger than maxBuffer because underneath we alloc 64k
// that matches our read sizes
assert.deepEqual(ret.stdout, msgOutBuf);

// While we are writing to stdout first which is expected to
// overflow the buffer and cause child to return, the actual
// write order can be reversed based on how uv loop get them.
// So expect either stdout or stderr to be holding the data
assert.ok(ret.stdout.toString() === msgOutBuf.toString() ||
ret.stderr.toString() === msgErrBuf.toString(),
'expected at least one stream to write back.');