Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b3W3uHbHAmM3orhn7b
20 lines
668 B
Plaintext
20 lines
668 B
Plaintext
== 1. WRONG: waitFor() first, read afterwards
|
|
child exited within 3s? false
|
|
child still alive? true
|
|
bytes sitting in the pipe: 65536
|
|
|
|
== 2. RIGHT (one stream): read to EOF, then waitFor()
|
|
read 200000 bytes, exit code 0
|
|
|
|
== 3. STILL WRONG: read stdout to EOF, but the child also fills stderr
|
|
stdout reader finished within 3s? false
|
|
|
|
== 4. FIX A: merge stderr into stdout, one stream to drain
|
|
read 400000 bytes, exit code 0
|
|
|
|
== 5. FIX B: drain both streams concurrently (what ProcessRunner does)
|
|
stdout=200000 stderr=200000 exit=0 timedOut=false
|
|
|
|
== 6. FIX C: do not pipe at all. Send output to a file or discard it
|
|
waitFor() returned immediately with exit code 0
|