-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: Add test for piping large input from stdin #5949
Conversation
|
||
const child = spawn(process.execPath, [__filename, 'child'], { stdio: 'pipe' }); | ||
|
||
const expectedBytes = 1024 * 1024; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity, is there any significance to this number? Will this reproduce the issue on all operating systems?
LGTM with a question. |
@cjihrig Answering your questions outside of the diff since more people might ask themselves that: I think any input size above 65536 bytes works, but when adding an additional listener via I can only verify that this test works on Linux. But as far as I can tell, the underlying issue depended solely on the relative timing of |
Check that piping a large chunk of data from `process.stdin` into `process.stdout` does not lose any data by verifying that the output has the same size as the input. This is a regression test for nodejs#5927 and fails for the commits in the range [ace1009..89abe86).
f13bddb
to
08214ba
Compare
Updated with your suggestion. |
LGTM |
LGTM and thanks, landed in 761787b. |
Check that piping a large chunk of data from `process.stdin` into `process.stdout` does not lose any data by verifying that the output has the same size as the input. This is a regression test for #5927 and fails for the commits in the range [ace1009..89abe86). PR-URL: #5949 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@thealphanerd @nodejs/lts ... while this test may not be entirely applicable to v4 but it may still be worth having. |
Should probably go onto lts so we can catch anything similar there |
@jasnell +1 |
Check that piping a large chunk of data from `process.stdin` into `process.stdout` does not lose any data by verifying that the output has the same size as the input. This is a regression test for #5927 and fails for the commits in the range [ace1009..89abe86). PR-URL: #5949 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Check that piping a large chunk of data from `process.stdin` into `process.stdout` does not lose any data by verifying that the output has the same size as the input. This is a regression test for #5927 and fails for the commits in the range [ace1009..89abe86). PR-URL: #5949 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Check that piping a large chunk of data from `process.stdin` into `process.stdout` does not lose any data by verifying that the output has the same size as the input. This is a regression test for #5927 and fails for the commits in the range [ace1009..89abe86). PR-URL: #5949 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Landed in |
Pull Request check-list
make -j8 test
(UNIX) orvcbuild test nosign
(Windows) pass withthis change (including linting)?
test (or a benchmark) included? (This is a regression test)
Affected core subsystem(s)
test
Description of change
Check that piping a large chunk of data from
process.stdin
intoprocess.stdout
does not lose any data by verifying that the output has the same size as the input.This is a regression test for #5927 and fails for the commits in the range [ace1009..89abe86).