Skip to content

Commit 9ad1587

Browse files
authored
fix(process): properly return exit code if missing (#1776)
1 parent f53b221 commit 9ad1587

File tree

4 files changed

+3
-8
lines changed

4 files changed

+3
-8
lines changed

packages/process/src/InvokedProcessPool.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class InvokedProcessPool implements Countable
2929
}
3030

3131
public function __construct(
32-
/** @var MutableArray<InvokedProcessInterface> */
32+
/** @var MutableArray<InvokedProcess> */
3333
private MutableArray $processes,
3434
) {}
3535

packages/process/src/ProcessResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function failed(): bool
3434
public static function fromSymfonyProcess(SymfonyProcess $process): self
3535
{
3636
return new self(
37-
exitCode: $process->getExitCode(),
37+
exitCode: $process->getExitCode() ?? -1,
3838
output: $process->getOutput(),
3939
errorOutput: $process->getErrorOutput(),
4040
);

packages/process/src/Testing/InvokedTestingProcess.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,7 @@ public function signal(int $signal): self
115115

116116
public function stop(float|int|Duration $timeout = 10, ?int $signal = null): self
117117
{
118-
if ($timeout instanceof Duration) {
119-
$timeout = $timeout->getTotalSeconds();
120-
}
121-
122-
$this->process->stop((float) $timeout, $signal);
118+
$this->remainingRunIterations = 0;
123119

124120
return $this;
125121
}

packages/process/src/Testing/TestingProcessExecutor.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Tempest\Process\Testing;
44

5-
use RuntimeException;
65
use Tempest\Process\GenericProcessExecutor;
76
use Tempest\Process\InvokedProcess;
87
use Tempest\Process\InvokedSystemProcess;

0 commit comments

Comments
 (0)