Skip to content

Commit 5e773a8

Browse files
minor #53909 [Process] Fix failing tests causing segfaults (alexandre-daubois)
This PR was merged into the 5.4 branch. Discussion ---------- [Process] Fix failing tests causing segfaults | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix tests | License | MIT [This PR](#53821) introduces some code that [triggers segfaults](https://github.com/symfony/symfony/actions/runs/7870905388/job/21473073396) in newer branches (7.x especially). We can achieve the same goal by using some bash script which is lighter and avoid the segfaults. I first tried this fix on 7.x and solved the issue (that does not happen on older branches). Commits ------- 041e178 [Process] Fix failing tests causing segfaults
2 parents 6986ab8 + 041e178 commit 5e773a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,7 @@ public function testFailingProcessWithMultipleCallsToProcGetStatus()
15701570
*/
15711571
public function testLongRunningProcessWithMultipleCallsToProcGetStatus()
15721572
{
1573-
$process = $this->getProcess('php -r "sleep(1); echo \'done\';"');
1573+
$process = $this->getProcess('sleep 1 && echo "done" && php -r "exit(0);"');
15741574
$process->start(static function () use ($process) {
15751575
return $process->isRunning();
15761576
});
@@ -1585,7 +1585,7 @@ public function testLongRunningProcessWithMultipleCallsToProcGetStatus()
15851585
*/
15861586
public function testLongRunningProcessWithMultipleCallsToProcGetStatusError()
15871587
{
1588-
$process = $this->getProcess('php -r "sleep(1); echo \'failure\'; exit(123);"');
1588+
$process = $this->getProcess('sleep 1 && echo "failure" && php -r "exit(123);"');
15891589
$process->start(static function () use ($process) {
15901590
return $process->isRunning();
15911591
});

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy