Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 47685ff

Browse filesBrowse files
committed
minor symfony#53532 [Process] Fixed inconsistent test (amne)
This PR was merged into the 5.4 branch. Discussion ---------- [Process] Fixed inconsistent test | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | N/A | License | MIT 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. ```bash amne@wnbpowerbox:~/work/projects/symfony$ php7.4 src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php The process "'php' '-r' 'echo '\''ready'\''; trigger_error('\''error'\'', E_USER_ERROR);'" exceeded the timeout of 0.5 seconds. amne@wnbpowerbox:~/work/projects/symfony$ php7.4 src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php The process "'php' '-r' 'echo '\''ready'\''; trigger_error('\''error'\'', E_USER_ERROR);'" exceeded the timeout of 0.5 seconds. amne@wnbpowerbox:~/work/projects/symfony$ php7.4 src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php The process "'php' '-r' 'echo '\''ready'\''; trigger_error('\''error'\'', E_USER_ERROR);'" exceeded the timeout of 0.5 seconds. amne@wnbpowerbox:~/work/projects/symfony$ php7.4 src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php The process "'php' '-r' 'echo '\''ready'\''; trigger_error('\''error'\'', E_USER_ERROR);'" exceeded the timeout of 0.5 seconds. amne@wnbpowerbox:~/work/projects/symfony$ php7.4 src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php PHP Fatal error: Uncaught Symfony\Component\Process\Exception\LogicException: Cannot send signal on a non running process. in /home/amne/work/projects/symfony/src/Symfony/Component/Process/Process.php:1502 Stack trace: #0 /home/amne/work/projects/symfony/src/Symfony/Component/Process/Process.php(516): Symfony\Component\Process\Process->doSignal() #1 /home/amne/work/projects/symfony/src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php(28): Symfony\Component\Process\Process->signal() #2 {main} thrown in /home/amne/work/projects/symfony/src/Symfony/Component/Process/Process.php on line 1502 ``` Commits ------- 00ee4ca [Process] Fixed inconsistent test
2 parents 9529c23 + 00ee4ca commit 47685ff
Copy full SHA for 47685ff

File tree

1 file changed

+1
-1
lines changed
Filter options

1 file changed

+1
-1
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php
+1-1Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.