cache icon indicating copy to clipboard operation
cache copied to clipboard

Unit test fails sometimes

Open phil-davis opened this issue 5 years ago • 3 comments
trafficstars

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.

phil-davis avatar Jan 26 '20 11:01 phil-davis

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

staabm avatar Jan 26 '20 11:01 staabm

It happened here also: https://travis-ci.org/sabre-io/cache/jobs/645320199?utm_medium=notification&utm_source=github_status

phil-davis avatar Feb 03 '20 07:02 phil-davis

And still happens sometimes: https://github.com/sabre-io/cache/pull/26

phil-davis avatar Oct 03 '20 15:10 phil-davis