From 175925109fa5e76a0e6c283e3a3c9ffc0dd7968a Mon Sep 17 00:00:00 2001 From: Cornel Cruceru Date: Sat, 13 Jan 2024 01:03:15 +0200 Subject: [PATCH] [Process] Fixed inconsistent test 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. --- Tests/ErrorProcessInitiator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/ErrorProcessInitiator.php b/Tests/ErrorProcessInitiator.php index 54168022..0b75add6 100644 --- a/Tests/ErrorProcessInitiator.php +++ b/Tests/ErrorProcessInitiator.php @@ -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();