8000 [Process] Fixed inconsistent test · wouterj/symfony@00ee4ca · GitHub
[go: up one dir, main page]

Skip to content

Commit 00ee4ca

Browse files
committed
[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.
1 parent 840c5cc commit 00ee4ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
while (!str_contains($process->getOutput(), 'ready')) {
2626
usleep(1000);
2727
}
28-
$process->signal(\SIGSTOP);
28+
$process->isRunning() && $process->signal(\SIGSTOP);
2929
$process->wait();
3030

3131
return $process->getExitCode();

0 commit comments

Comments
 (0)
0