diff --git a/tests/AbstractLoopTest.php b/tests/AbstractLoopTest.php index 29bde5aa..50b3e432 100644 --- a/tests/AbstractLoopTest.php +++ b/tests/AbstractLoopTest.php @@ -9,8 +9,12 @@ abstract class AbstractLoopTest extends TestCase */ protected $loop; + private $tickTimeout; + public function setUp() { + // HHVM is a bit slow, so give it more time + $this->tickTimeout = defined('HHVM_VERSION') ? 0.02 : 0.005; $this->loop = $this->createLoop(); } @@ -161,7 +165,7 @@ public function testRemoveInvalid() /** @test */ public function emptyRunShouldSimplyReturn() { - $this->assertRunFasterThan(0.005); + $this->assertRunFasterThan($this->tickTimeout); } /** @test */ @@ -176,7 +180,7 @@ public function runShouldReturnWhenNoMoreFds() $this->writeToStream($input, "foo\n"); - $this->assertRunFasterThan(0.015); + $this->assertRunFasterThan($this->tickTimeout * 2); } /** @test */ @@ -191,10 +195,10 @@ public function stopShouldStopRunningLoop() $this->writeToStream($input, "foo\n"); - $this->assertRunFasterThan(0.005); + $this->assertRunFasterThan($this->tickTimeout * 2); } - public function testStopShouldPreventRunFromBlocking($timeLimit = 0.005) + public function testStopShouldPreventRunFromBlocking() { $this->loop->addTimer( 1, @@ -209,7 +213,7 @@ function () { } ); - $this->assertRunFasterThan($timeLimit); + $this->assertRunFasterThan($this->tickTimeout * 2); } public function testIgnoreRemovedCallback() diff --git a/tests/StreamSelectLoopTest.php b/tests/StreamSelectLoopTest.php index 624ee447..61b059c1 100644 --- a/tests/StreamSelectLoopTest.php +++ b/tests/StreamSelectLoopTest.php @@ -37,17 +37,6 @@ public function testStreamSelectTimeoutEmulation() $this->assertGreaterThan(0.04, $interval); } - public function testStopShouldPreventRunFromBlocking($timeLimit = 0.005) - { - if (defined('HHVM_VERSION')) { - // HHVM is a bit slow, so give it more time - parent::testStopShouldPreventRunFromBlocking(0.5); - } else { - parent::testStopShouldPreventRunFromBlocking($timeLimit); - } - } - - public function signalProvider() { return [
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: