wiki.techinc.nl/tests/phpunit/unit/includes/libs/objectcache
Timo Tijhof 0e3727b23b objectcache: Fix flaky WANObjectCacheTest::testLockTSESlow case
I noticed this in CI during development for Ia893ddb36427eb5e9bff,
however, it is reproducible on latest master as well. Locally, it
happens about 1/30 times:

```
$ php phpunit.php --filter testLockTSESlow unit/includes/libs/objectcache/
Using PHP 8.1.13
PHPUnit 9.5.27 by Sebastian Bergmann and contributors.
There was 1 failure:
1) WANObjectCacheTest::testLockTSESlow with data set #0 (array('hash_tag'), '{')
Callback not used (mutex not acquired, stale value used)
Failed asserting that 3 is identical to 2.
/w/tests/phpunit/unit/includes/libs/objectcache/WANObjectCacheTest.php:1311
/w/tests/phpunit/MediaWikiUnitTestCase.php:11
```

* Remove randomisation from test. The HashBag is empty at this point,
  and a dedicated instance is created for each test case. Remove doubt
  over conflicts or other uncertainty, and make it easier to debug at
  the same time.

* Increase mocked time gap from 2s to 32s similar to what the
  previous assertion in the same test does already. 2s does not actually
  go past the reduced logical TTL which is 30s at this point.

  It seems to still pass on master in most cases, but it makes sense
  that it can fail. I could not reproduce failures after this change.

Change-Id: I6e491ae3c4f41413e7a952aa0796a787d559ac48
2023-01-13 23:46:51 +00:00
..
CachedBagOStuffTest.php objectcache: add watchErrors() to BagOStuff/WANObjectCache 2021-11-10 00:38:27 +00:00
HashBagOStuffTest.php BagOStuff: never use the full cache key as metrics key 2022-11-21 14:03:44 +01:00
ReplicatedBagOStuffTest.php objectcache: add watchErrors() to BagOStuff/WANObjectCache 2021-11-10 00:38:27 +00:00
WANObjectCacheTest.php objectcache: Fix flaky WANObjectCacheTest::testLockTSESlow case 2023-01-13 23:46:51 +00:00