[Process] Reduce I/O load on Windows platform
This commit is contained in:
parent
ace5a29867
commit
ff0bb01a91
|
@ -284,6 +284,8 @@ class ProcessPipes
|
|||
private function readStreams($blocking, $close = false)
|
||||
{
|
||||
if (empty($this->pipes)) {
|
||||
usleep(Process::TIMEOUT_PRECISION * 1E4);
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
|
|
|
@ -583,7 +583,14 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
|
|||
}
|
||||
$duration = microtime(true) - $start;
|
||||
|
||||
$this->assertLessThan($timeout + Process::TIMEOUT_PRECISION, $duration);
|
||||
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
|
||||
// Windows is a bit slower as it read file handles, then allow twice the precision
|
||||
$maxDuration = $timeout + 2 * Process::TIMEOUT_PRECISION;
|
||||
} else {
|
||||
$maxDuration = $timeout + Process::TIMEOUT_PRECISION;
|
||||
}
|
||||
|
||||
$this->assertLessThan($maxDuration, $duration);
|
||||
}
|
||||
|
||||
public function testCheckTimeoutOnNonStartedProcess()
|
||||
|
|
Reference in New Issue