Skip to content

Commit

Permalink
minor #53909 [Process] Fix failing tests causing segfaults (alexandre…
Browse files Browse the repository at this point in the history
…-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
  • Loading branch information
nicolas-grekas committed Feb 12, 2024
2 parents 6986ab8 + 041e178 commit 5e773a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/Process/Tests/ProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1570,7 +1570,7 @@ public function testFailingProcessWithMultipleCallsToProcGetStatus()
*/
public function testLongRunningProcessWithMultipleCallsToProcGetStatus()
{
$process = $this->getProcess('php -r "sleep(1); echo \'done\';"');
$process = $this->getProcess('sleep 1 && echo "done" && php -r "exit(0);"');
$process->start(static function () use ($process) {
return $process->isRunning();
});
Expand All @@ -1585,7 +1585,7 @@ public function testLongRunningProcessWithMultipleCallsToProcGetStatus()
*/
public function testLongRunningProcessWithMultipleCallsToProcGetStatusError()
{
$process = $this->getProcess('php -r "sleep(1); echo \'failure\'; exit(123);"');
$process = $this->getProcess('sleep 1 && echo "failure" && php -r "exit(123);"');
$process->start(static function () use ($process) {
return $process->isRunning();
});
Expand Down

0 comments on commit 5e773a8

Please sign in to comment.