== 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