From 00ee4ca0ec97d9c5e19a36ddcbf9bae4288bfa7b 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. --- src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php b/src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php index 541680224d740..0b75add63cf01 100644 --- a/src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php +++ b/src/Symfony/Component/Process/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();