Skip to content

Commit 5bb058c

Browse files
committed
refactor: wait all processes instead of just ones marked as running
1 parent f6fc06b commit 5bb058c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

packages/process/src/InvokedProcessPool.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ final class InvokedProcessPool implements Countable
1515
*/
1616
public ImmutableArray $running {
1717
get => $this->processes
18-
->filter(fn (InvokedProcess $process) => $process->running)
19-
->toImmutableArray();
18+
->toImmutableArray()
19+
->filter(fn (InvokedProcess $process) => $process->running);
2020
}
2121

2222
/**
@@ -55,7 +55,7 @@ public function stop(float|int|Duration $timeout = 10, ?int $signal = null): Imm
5555
public function wait(): ProcessPoolResults
5656
{
5757
return new ProcessPoolResults(
58-
$this->running->map(fn (InvokedProcess $process) => $process->wait()),
58+
$this->all->map(fn (InvokedProcess $process) => $process->wait()),
5959
);
6060
}
6161

packages/process/tests/PoolTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public function test_pool(): void
3232

3333
$results = $invoked->wait();
3434

35-
var_dump($results, $results->count());
3635
$this->assertSame(2, $results->count());
3736
$this->assertStringEqualsStringIgnoringLineEndings("hello\n", $results[0]->output);
3837
$this->assertStringEqualsStringIgnoringLineEndings("world\n", $results[1]->output);

0 commit comments

Comments
 (0)