[Process] Fix for #8754 (Timed-out processes are successful)
This commit is contained in:
parent
4af7276f89
commit
fa01e6b4d3
@ -646,9 +646,9 @@ class Process
|
||||
$timeoutMicro = microtime(true) + $timeout;
|
||||
if ($this->isRunning()) {
|
||||
proc_terminate($this->process);
|
||||
while ($this->isRunning() && microtime(true) < $timeoutMicro) {
|
||||
do {
|
||||
usleep(1000);
|
||||
}
|
||||
} while ($this->isRunning() && microtime(true) < $timeoutMicro);
|
||||
|
||||
if ($this->isRunning() && !$this->isSigchildEnabled()) {
|
||||
if (null !== $signal || defined('SIGKILL')) {
|
||||
|
@ -444,6 +444,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
|
||||
$duration = microtime(true) - $start;
|
||||
|
||||
$this->assertLessThan($timeout + $precision, $duration);
|
||||
$this->assertFalse($process->isSuccessful());
|
||||
}
|
||||
|
||||
public function testGetPid()
|
||||
|
@ -61,6 +61,14 @@ class SigchildDisabledProcessTest extends AbstractProcessTest
|
||||
parent::testProcessWithoutTermSignal();
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\Process\Exception\RuntimeException
|
||||
*/
|
||||
public function testCheckTimeoutOnStartedProcess()
|
||||
{
|
||||
parent::testCheckTimeoutOnStartedProcess();
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\Process\Exception\RuntimeException
|
||||
*/
|
||||
|
Reference in New Issue
Block a user