mirror of
https://github.com/danog/amp.git
synced 2024-11-30 04:29:08 +01:00
Add 1ms grace period for timing tests
This commit is contained in:
parent
d8f3810310
commit
179eb3d6f8
@ -21,7 +21,7 @@ class PauseTest extends \PHPUnit\Framework\TestCase {
|
||||
$promise->when($callback);
|
||||
});
|
||||
|
||||
$this->assertGreaterThanOrEqual($time, (microtime(true) - $start) * 1000);
|
||||
$this->assertGreaterThanOrEqual($time - 1 /* 1ms grace period */, (microtime(true) - $start) * 1000);
|
||||
$this->assertSame($value, $result);
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ class PauseTest extends \PHPUnit\Framework\TestCase {
|
||||
$promise->when($callback);
|
||||
});
|
||||
|
||||
$this->assertLessThanOrEqual($time, (microtime(true) - $start) * 1000);
|
||||
$this->assertLessThanOrEqual($time - 1 /* 1ms grace period */, (microtime(true) - $start) * 1000);
|
||||
$this->assertFalse($invoked);
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ class ProducerTest extends TestCase {
|
||||
});
|
||||
});
|
||||
|
||||
$this->assertGreaterThan(self::TIMEOUT * $emits, $time * 1000);
|
||||
$this->assertGreaterThan(self::TIMEOUT * $emits - 1 /* 1ms grace period */, $time * 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -137,7 +137,7 @@ class ProducerTest extends TestCase {
|
||||
});
|
||||
});
|
||||
|
||||
$this->assertGreaterThan(self::TIMEOUT * $emits, $time * 1000);
|
||||
$this->assertGreaterThan(self::TIMEOUT * $emits - 1 /* 1ms grace period */, $time * 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user