[Process] Fix volatile test
This commit is contained in:
parent
0430d2095f
commit
dae19422ec
@ -800,9 +800,6 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($process->isSuccessful());
|
||||
}
|
||||
|
||||
/**
|
||||
* @group idle-timeout
|
||||
*/
|
||||
public function testIdleTimeout()
|
||||
{
|
||||
$process = $this->getProcess('php -r "sleep(3);"');
|
||||
@ -820,21 +817,18 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @group idle-timeout
|
||||
*/
|
||||
public function testIdleTimeoutNotExceededWhenOutputIsSent()
|
||||
{
|
||||
$process = $this->getProcess('php -r "echo \'foo\'; sleep(1); echo \'foo\'; sleep(1); echo \'foo\'; sleep(1); "');
|
||||
$process = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 30; while ($n--) {echo "foo\n"; usleep(100000); }')));
|
||||
$process->setTimeout(2);
|
||||
$process->setIdleTimeout(1.5);
|
||||
$process->setIdleTimeout(1);
|
||||
|
||||
try {
|
||||
$process->run();
|
||||
$this->fail('A timeout exception was expected.');
|
||||
} catch (ProcessTimedOutException $ex) {
|
||||
$this->assertTrue($ex->isGeneralTimeout());
|
||||
$this->assertFalse($ex->isIdleTimeout());
|
||||
$this->assertTrue($ex->isGeneralTimeout(), 'A general timeout is expected.');
|
||||
$this->assertFalse($ex->isIdleTimeout(), 'No idle timeout is expected.');
|
||||
$this->assertEquals(2, $ex->getExceededTimeout());
|
||||
}
|
||||
}
|
||||
|
@ -76,6 +76,7 @@ class StopwatchEventTest extends \PHPUnit_Framework_TestCase
|
||||
$event->start();
|
||||
usleep(100000);
|
||||
$event->stop();
|
||||
usleep(50000);
|
||||
$event->start();
|
||||
usleep(100000);
|
||||
$event->stop();
|
||||
@ -93,6 +94,7 @@ class StopwatchEventTest extends \PHPUnit_Framework_TestCase
|
||||
$event->start();
|
||||
usleep(100000);
|
||||
$event->stop();
|
||||
usleep(50000);
|
||||
$event->start();
|
||||
usleep(100000);
|
||||
$this->assertEquals(100, $event->getDuration(), null, self::DELTA);
|
||||
|
Reference in New Issue
Block a user