Skip to content

Commit f6fc06b

Browse files
committed
fix: exhaust output when waiting fake process
1 parent 9be3df7 commit f6fc06b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/process/src/Testing/InvokedTestingProcess.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ public function wait(?callable $output = null): ProcessResult
134134
return $this->getProcessResult();
135135
}
136136

137+
// @mago-expect best-practices/no-empty-loop
138+
while ($this->invokeOutputHandlerWithNextLineOfOutput()) {
139+
}
140+
137141
$this->remainingRunIterations = 0;
138142

139143
return $this->getProcessResult();

packages/process/tests/PoolTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public function test_concurrently(): void
4646
'echo world',
4747
]);
4848

49-
var_dump($results, $results->count());
5049
$this->assertSame(2, $results->count());
5150
$this->assertStringEqualsStringIgnoringLineEndings("hello\n", $results[0]->output);
5251
$this->assertStringEqualsStringIgnoringLineEndings("world\n", $results[1]->output);

0 commit comments

Comments
 (0)