diff --git a/test/Loop/DriverTest.php b/test/Loop/DriverTest.php index 0c74d8e..326801d 100644 --- a/test/Loop/DriverTest.php +++ b/test/Loop/DriverTest.php @@ -1487,7 +1487,8 @@ abstract class DriverTest extends TestCase { public function testBug163ConsecutiveDelayed() { $emits = 3; - Loop::run(function () use (&$time, $emits) { + + $this->loop->defer(function () use (&$time, $emits) { $time = microtime(true); for ($i = 0; $i < $emits; ++$i) { yield new Delayed(100); @@ -1495,6 +1496,8 @@ abstract class DriverTest extends TestCase { $time = microtime(true) - $time; }); + $this->loop->run(); + $this->assertGreaterThan(100 * $emits - 1 /* 1ms grace period */, $time * 1000); } }