Skip to content

[tool] stdin.flush calls on processes started by FakeProcessManager never complete #151151

@andrewkolos

Description

@andrewkolos

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.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listteam-toolOwned by Flutter Tool teamtriaged-toolTriaged by Flutter Tool team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions