Fix child process stdio data loss with slow piped consumers
Checklist
-
tests and code linting passes -
a test and/or benchmark is included -
documentation is changed or added -
the commit message follows commit guidelines
Affected core subsystem(s)
- child-process
Description of change
The flushStdio()
checks if there are readable handlers attached to the stdio streams to prevent data loss but it doesn't check if there are piped consumers. Change it so that it checks pipesCount
too.
I also fixed the previous testcase on the same issue to actually catch the regression as it would previously pass regardless of what flushStdio was doing.
Fixes #7184 (closed)