Skip to content

Commit 232dfb7

Browse files
committed
harden cache expiration test
In the worst case when the process sleeps for exactly one second the current timestamp would be exactly the same as the expiration time. Increasing the sleep time ensures that the tested item is always expired when executing the test.
1 parent bb7e1ab commit 232dfb7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Symfony/Component/Cache/Tests/Adapter/ProxyAdapterAndRedisAdapterTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ static function (CacheItem $item, $expiry) {
6666
$this->assertSame($value, $this->cache->getItem('baz')->get());
6767

6868
sleep(1);
69+
usleep(100000);
6970
$this->assertSame($value, $this->cache->getItem('foo')->get());
7071
$this->assertSame($value, $this->cache->getItem('bar')->get());
7172
$this->assertFalse($this->cache->getItem('baz')->isHit());

0 commit comments

Comments
 (0)