-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
child_process: truncate output when maxBuffer is exceeded #24951
child_process: truncate output when maxBuffer is exceeded #24951
Conversation
@Fishrock123 I would argue this is a kind of bug fix and we do not need the option for it. We could just run CITGM and see if anyone relies on this behavior but I actually doubt that a lot of code relies on the specific error code and that the output is empty in such a case. |
@nodejs/child_process, and also @nodejs/citgm I suppose. (Since there's no way I can decipher output even if I start a run...) |
I am happy to look into the CITGM result if you refactor the code / open an alternative one which adds the functionality without option. |
978d141
to
c059ef0
Compare
c059ef0
to
dfd1f12
Compare
@BridgeAR updated as per discussion CI: https://ci.nodejs.org/job/node-test-pull-request/19457/ |
dfd1f12
to
31e35bd
Compare
Windows test failures look relevant. |
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.
Blocking on relevant CI failures on Windows. Feel free to dismiss once those are addressed. I'm just blocking to make sure no one accidentally lands this before it's fixed.
🤨(wat.) (Why did 4 of the same test case run in anyways:
So.... on windows ( |
31e35bd
to
42db815
Compare
Resume Build CI: https://ci.nodejs.org/job/node-test-pull-request/19672/ ✔️ |
No one has reviewed this since the last commit was pushed. @addaleax @BridgeAR Can you confirm that this still looks good to you? Anyone else want to review it? @nodejs/child_process @Fishrock123 Are you still in Camp "I Like To Land My Own PRs, Please Don't Land Them For Me, KThxBai"? Or have you moved over to Camp "Sure, Whatevs, Land My PRs If You Want, Save Me The Trouble, Kewl"? |
I would prefer to land them myself to avoid surprises. Anyways this should be ready to land? It's not clear to me if people are actually ok with this considering no one from the relevant domain has ever commented. |
Technically, yes, I believe so.
If you'd be more comfortable getting the approval of someone specific, please do, obviously. (As you know, GitHub notifications can be overwhelming so it's sometimes a good idea to ping folks via other channels.) |
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.
Yes, still LGTM
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.
Still LGTM
42db815
to
3f6aebf
Compare
|
Expands this test case to check what happens to stdout/stderr when maxBuffer is exceeded. Also changes how cases are checked so that assertion stacks are tracable to their test case, aka 'make it actually debuggable'. PR-URL: #24951 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Preserves truncated output for `child_process.exec()` when `maxBuffer` is exceeded. This is particularly useful for commands which have indistinguishable error codes for what output they produce. PR-URL: #24951 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Fix test/pummel/test-exec.js which broke as a result of e47f972 (nodejs#24951). (Until very recently, pummel tests were not run at all in CI and currently only run nightly on master.)
Expands this test case to check what happens to stdout/stderr when maxBuffer is exceeded. Also changes how cases are checked so that assertion stacks are tracable to their test case, aka 'make it actually debuggable'. PR-URL: #24951 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Preserves truncated output for `child_process.exec()` when `maxBuffer` is exceeded. This is particularly useful for commands which have indistinguishable error codes for what output they produce. PR-URL: #24951 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Fix test/pummel/test-exec.js which broke as a result of e47f972 (nodejs#24951). (Until very recently, pummel tests were not run at all in CI and currently only run nightly on master.) PR-URL: nodejs#25677 Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Fix test/pummel/test-exec.js which broke as a result of e47f972 (#24951). (Until very recently, pummel tests were not run at all in CI and currently only run nightly on master.) PR-URL: #25677 Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Notable Changes: * events: * For unhandled `error` events with an argument that is not an `Error` object, the resulting exeption will have more information about the argument. #25621 * child_process: * When the `maxBuffer` option is passed, `stdout` and `stderr` will be truncated rather than unavailable in case of an error. #24951 * policy: * Experimental support for module integrity checks through a manifest file is implemented now. #23834 * n-api: * The `napi_threadsafe_function` feature is now stable. #25556 * report: * An experimental diagnostic API for capturing process state is available as `process.report` and through command line flags. #22712 * tls: * `tls.connect()` takes a `timeout` option analogous to the `net.connect()` one. #25517 * worker: * `process.umask()` is available as a read-only function inside Worker threads now. #25526 * An `execArgv` option that supports a subset of Node.js command line options is supported now. #25467 PR-URL: #25687
Notable Changes: * events: * For unhandled `error` events with an argument that is not an `Error` object, the resulting exeption will have more information about the argument. #25621 * child_process: * When the `maxBuffer` option is passed, `stdout` and `stderr` will be truncated rather than unavailable in case of an error. #24951 * policy: * Experimental support for module integrity checks through a manifest file is implemented now. #23834 * n-api: * The `napi_threadsafe_function` feature is now stable. #25556 * report: * An experimental diagnostic API for capturing process state is available as `process.report` and through command line flags. #22712 * tls: * `tls.connect()` takes a `timeout` option analogous to the `net.connect()` one. #25517 * worker: * `process.umask()` is available as a read-only function inside Worker threads now. #25526 * An `execArgv` option that supports a subset of Node.js command line options is supported now. #25467 PR-URL: #25687
Expands this test case to check what happens to stdout/stderr when maxBuffer is exceeded. Also changes how cases are checked so that assertion stacks are tracable to their test case, aka 'make it actually debuggable'. PR-URL: #24951 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Preserves truncated output for `child_process.exec()` when `maxBuffer` is exceeded. This is particularly useful for commands which have indistinguishable error codes for what output they produce. PR-URL: #24951 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Fix test/pummel/test-exec.js which broke as a result of e47f972 (#24951). (Until very recently, pummel tests were not run at all in CI and currently only run nightly on master.) PR-URL: #25677 Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Expands this test case to check what happens to stdout/stderr when maxBuffer is exceeded. Also changes how cases are checked so that assertion stacks are tracable to their test case, aka 'make it actually debuggable'. PR-URL: #24951 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Preserves truncated output for `child_process.exec()` when `maxBuffer` is exceeded. This is particularly useful for commands which have indistinguishable error codes for what output they produce. PR-URL: #24951 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Fix test/pummel/test-exec.js which broke as a result of e47f972 (#24951). (Until very recently, pummel tests were not run at all in CI and currently only run nightly on master.) PR-URL: #25677 Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Expands this test case to check what happens to stdout/stderr when maxBuffer is exceeded. Also changes how cases are checked so that assertion stacks are tracable to their test case, aka 'make it actually debuggable'. PR-URL: #24951 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Preserves truncated output for `child_process.exec()` when `maxBuffer` is exceeded. This is particularly useful for commands which have indistinguishable error codes for what output they produce. PR-URL: #24951 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Fix test/pummel/test-exec.js which broke as a result of e47f972 (#24951). (Until very recently, pummel tests were not run at all in CI and currently only run nightly on master.) PR-URL: #25677 Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Preserves truncated output for
child_process.exec()
whenmaxBuffer
is exceeded.This is particularly useful for commands which have indistinguishable
error codes for what output they produce.
I am presently running into this and just vendoring
exec
with a similar change into some code because... well, I need it, and don't want to re-write all ofexec
by hand.Done as an added option / semver-minor because I want it sooner. IMO we should make this the default behavior but I think there's a chance something relies on the old behavior.Done as patch as per discussion.
The old behavior was also completely untested so... commit 1 fixes that.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes