cache
cache copied to clipboard
Unit test fails sometimes
On PHP 7.3 it failed just today:
$ ./bin/phpunit --verbose --configuration tests/phpunit.xml.dist
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.
Runtime: PHP 7.3.14 with Xdebug 2.9.1
Configuration: /home/travis/build/sabre-io/cache/tests/phpunit.xml.dist
.............................FF.........S........................ 65 / 72 ( 90%)
....... 72 / 72 (100%)
Time: 12.07 seconds, Memory: 4.00 MB
There were 2 failures:
1) Sabre\Cache\MemcachedTest::testSetExpire
Failed asserting that null matches expected 'bar'.
/home/travis/build/sabre-io/cache/tests/AbstractCacheTest.php:80
2) Sabre\Cache\MemcachedTest::testSetExpireDateInterval
Failed asserting that null matches expected 'bar'.
/home/travis/build/sabre-io/cache/tests/AbstractCacheTest.php:96
But the same unit tests passed on 7.1 7.3 7.4 ???
It passed when I reran the PHP 7.3 job: https://travis-ci.org/sabre-io/cache/jobs/641984569?utm_medium=notification&utm_source=github_status
So I guess there is a timing issue somewhere? So there is some timing issue with these unit tests.
I guess the problem is that different tests use the same cache-keys and therefore share global state https://github.com/sabre-io/cache/blob/master/tests/AbstractCacheTest.php
It happened here also: https://travis-ci.org/sabre-io/cache/jobs/645320199?utm_medium=notification&utm_source=github_status
And still happens sometimes: https://github.com/sabre-io/cache/pull/26