#54262: fix: deliver utilityProcess output written just before the child exits
Description of Change
When the child exited, utilityProcess removed every listener from the child.stdout / child.stderr streams it hands out, so output the child wrote just before exiting (still in the pipe, or read but not yet emitted) never reached 'data' listeners. The streams are now left alone and end once the pipe has been drained; a stream that never got connected is ended on exit so readers don't wait forever. child.stdout / child.stderr still read as null after 'exit', as documented.
The stdout/stderr property specs and the electron/lol import spec read whatever had arrived by 'exit', which is how this showed up; they now wait for the expected output.
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
-
npm testpasses - tests are changed or added
Release Notes
Notes: Fixed utilityProcess dropping stdout/stderr output that the child wrote immediately before exiting.
Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron