diff --git a/src/Symfony/Component/Process/Tests/AbstractProcessTest.php b/src/Symfony/Component/Process/Tests/AbstractProcessTest.php index 5348f57a9c..76002c1639 100644 --- a/src/Symfony/Component/Process/Tests/AbstractProcessTest.php +++ b/src/Symfony/Component/Process/Tests/AbstractProcessTest.php @@ -263,7 +263,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testStop() { - $process = $this->getProcess('php -r "while (true) {}"'); + $process = $this->getProcess('php -r "sleep(4);"'); $process->start(); $this->assertTrue($process->isRunning()); $process->stop(); @@ -279,7 +279,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testIsNotSuccessful() { - $process = $this->getProcess('php -r "while (true) {}"'); + $process = $this->getProcess('php -r "sleep(4);"'); $process->start(); $this->assertTrue($process->isRunning()); $process->stop(); @@ -314,7 +314,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $this->markTestSkipped('Windows does not support POSIX signals'); } - $process = $this->getProcess('php -r "while (true) {}"'); + $process = $this->getProcess('php -r "sleep(4);"'); $process->start(); $process->stop(); $this->assertTrue($process->hasBeenSignaled()); @@ -329,7 +329,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase // SIGTERM is only defined if pcntl extension is present $termSignal = defined('SIGTERM') ? SIGTERM : 15; - $process = $this->getProcess('php -r "while (true) {}"'); + $process = $this->getProcess('php -r "sleep(4);"'); $process->start(); $process->stop(); @@ -360,7 +360,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase // Sleep doesn't work as it will allow the process to handle signals and close // file handles from the other end. - $process = $this->getProcess('php -r "while (true) {}"'); + $process = $this->getProcess('php -r "sleep 4"'); $process->start(); // PHP will deadlock when it tries to cleanup $process