wiki.techinc.nl/tests/phpunit/unit/includes/libs
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
..
composer
DebugInfo Add some helpers to filter properties out of var_dump() 2022-10-12 12:42:23 -04:00
filebackend tests: Minor follow-up to MySQLPlatformTest/FileBackendTest php8.1 fixes 2022-07-27 18:28:35 -07:00
http Drop some pre-7.4 php compat code 2022-09-29 14:40:13 +00:00
Message
Metrics Metrics: move metric implementations to subdirectory 2022-11-09 19:53:32 -01:00
mime Call ZipDirectoryReader from MimeAnalyzer 2022-05-03 14:43:26 +10:00
objectcache objectcache: Fix flaky WANObjectCacheTest::testLockTSESlow case 2023-01-13 23:46:51 +00:00
ParamValidator tests: Remove assertion of spec in ParamValidatorTest::testGetTypeDef 2023-01-06 04:01:09 +01:00
rdbms rdbms: Consolidate logger channels into one 2023-01-03 22:46:38 +00:00
stats
WRStats RateLimiter: improve test coverage 2022-07-16 11:00:59 +00:00
ArrayUtilsTest.php Use array_key_first()/array_key_last() in some places 2022-10-21 15:01:59 +11:00
CookieTest.php
DeflateTest.php mw.deflate: Add tests 2022-07-11 17:55:36 +01:00
DnsSrvDiscovererTest.php tests: Replace assertEmpty with assertSame 2022-11-25 00:42:53 +01:00
GhostFieldAccessTraitTest.php
HashRingTest.php
HtmlArmorTest.php
JsMinPlusTest.php resourceloader: Add regression test for long strings and regexes 2022-02-23 11:04:37 +11:00
MapCacheLRUTest.php Remove pre PHP 7.4 serialize()/unserialize() 2022-11-10 19:25:01 +00:00
MemoizedCallableTest.php Tests: Cleanup some unnecessary nested function calls 2022-06-06 01:02:34 +01:00
MWCryptHashTest.php MWCryptHashTest: Move into libs directory 2022-07-10 05:15:54 -04:00
SamplingStatsdClientTest.php Replace trivial usa of mock builder with createMock() shortcut 2022-07-15 16:43:48 +00:00
StaticArrayWriterTest.php
StringUtilsTest.php tests: Fix types in documentation by adding use statements 2022-05-29 07:11:15 +00:00
TimingTest.php Use native array_column() in tests instead of loops 2022-08-16 15:41:14 +02:00
XhprofDataTest.php Use short array destructuring instead of list() 2022-10-21 15:33:37 +11:00
XmlTypeCheckTest.php tests: Do not use class alias in @covers 2022-05-28 00:37:43 +02:00