Skip to content

Commit

Permalink
[Process] Fixed inconsistent test
Browse files Browse the repository at this point in the history
Sometimes the process no longer appears to be running when the signal is sent which causes a LogicException to be thrown.
This doesn't appear to be consistent and I can reproduce it randomly on my local machine. To avoid having tests fail at random
I decided that it's better to send the signal only if the process is still marked as running.
  • Loading branch information
amne committed Jan 12, 2024
1 parent 9a2172b commit 1759251
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Tests/ErrorProcessInitiator.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
while (!str_contains($process->getOutput(), 'ready')) {
usleep(1000);
}
$process->signal(\SIGSTOP);
$process->isRunning() && $process->signal(\SIGSTOP);
$process->wait();

return $process->getExitCode();
Expand Down

0 comments on commit 1759251

Please sign in to comment.