This blocks fixing #137184, the top crasher of the flutter tool.
Discovered while working on #151146.
Full repro
Write a tools test like this:
testWithoutContext('stdin.flush completes', () async {
const String commandName = 'command';
final FakeProcessManager processManager = FakeProcessManager.list(
<FakeCommand>[
const FakeCommand(command: <Pattern>[commandName]),
],
);
final Process process = await processManager.start(<String>[commandName]);
process.stdin.write('hi');
await process.stdin.flush();
});
Run it. It will never complete. Interestingly, the process.stdin.write('hi'); is necessary for this to repro.