[Process] Make test AbstractProcessTest::testStartAfterATimeout useful again
This commit is contained in:
parent
b8e4b4af3d
commit
1be266fea0
|
@ -724,12 +724,12 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
|
||||||
|
|
||||||
public function testStartAfterATimeout()
|
public function testStartAfterATimeout()
|
||||||
{
|
{
|
||||||
$process = $this->getProcess('php -r "$n = 1000; while ($n--) {echo \'\'; usleep(1000); }"');
|
$process = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 1000; while ($n--) {echo \'\'; usleep(1000); }')));
|
||||||
$process->setTimeout(0.1);
|
$process->setTimeout(0.1);
|
||||||
try {
|
try {
|
||||||
$process->run();
|
$process->run();
|
||||||
$this->fail('An exception should have been raised.');
|
$this->fail('A RuntimeException should have been raised.');
|
||||||
} catch (\Exception $e) {
|
} catch (RuntimeException $e) {
|
||||||
}
|
}
|
||||||
$process->start();
|
$process->start();
|
||||||
usleep(10000);
|
usleep(10000);
|
||||||
|
|
Reference in New Issue