wiki.techinc.nl/tests/phpunit/unit/includes
Dan Duvall a824da0f34 Support stale cached settings for failover
Require a `CacheableSource` implementation to signal whether stale
settings may be served from the cache by implementing an
`allowsStaleLoad()` method. This will be useful for sources (e.g. etcd)
that expect some degree of unavailability and failover during
unavailability is desired.

In order to support stale results, `CachedSource` sets cache items with
an indefinite TTL but uses the computed expiry timestamp in the envelope
to consider whether the item is considered expired as opposed to a true
miss where the item is malformed or not present in the cache store.  If
a `SettingsBuilderException` is thrown during the source's `load()`
method but the cache check was not a real miss, the stale cached results
are returned.

Note there is currently no pruning of cache items so it is advised that
`CacheableSource` implementations for which stale loads are allowed also
implement an immutable `getHashKey()` based on constructor arguments.

Bug: T296771
Change-Id: Ida0698a237dc0939230799700b6f54956f033d50
2022-01-21 13:31:09 -08:00
..
actions Revert "Replace deprecated methods IContextSource::getWikiPage && IContextSource::canUseWikiPage" 2021-12-14 12:43:15 -08:00
api Move ApiWatchlistTraitTest back to unit tests 2021-07-06 20:37:45 +00:00
auth Hard deprecate the setters of AbstractAuthenticationProvider class 2021-05-31 13:02:39 +00:00
block Cleanup hard-deprecated code in blocks. 2021-10-26 06:44:05 -07:00
cache Add BacklinkCacheFactory Service 2021-09-09 09:58:52 +01:00
changes Remove some more comments that literally repeat the code 2021-12-09 19:01:36 +01:00
CommentFormatter Introduce CommentFormatter 2021-09-28 11:13:03 -07:00
composer
config Introduce includes/Storage/PageUpdaterFactory 2021-07-19 12:15:26 +02:00
content build: Updating dependencies 2021-07-22 03:36:05 +00:00
context Revert "Use CsrfTokenSet as CSRF token source" 2021-08-05 15:48:26 -07:00
dao Give WikiAwareEntityTrait it's own unit tests. 2021-04-27 20:31:14 -07:00
db Convert MWLBFactoryTest to pure unit tests 2021-04-14 16:48:30 +00:00
debug build: Updating dependencies 2021-07-22 03:36:05 +00:00
deferred Tests: Mark more more closures as static 2021-02-09 02:55:57 +00:00
diff Remove meaningless ->expects( $this->any() ) from all tests 2021-04-23 11:58:58 +02:00
editpage Replace easy usages of User for UserIdentity/Authority 2021-06-09 07:53:52 -07:00
exception build: Updating dependencies 2021-07-22 03:36:05 +00:00
filebackend Replace usages of deprecated wfWikiID() 2021-12-21 02:05:55 +00:00
filerepo/file
GlobalFunctions
historyblob build: Updating dependencies 2021-07-22 03:36:05 +00:00
HookContainer Remove or replace usages of "sanity" 2021-11-21 16:42:31 +00:00
htmlform Hard deprecate User::setOption() 2021-09-26 17:18:54 +02:00
http tests: Use ::class in assertInstanceOf function 2022-01-16 21:17:09 +01:00
import WikiImporter: inject services 2021-05-24 23:10:07 +02:00
installer
interwiki build: Updating dependencies 2021-07-22 03:36:05 +00:00
jobqueue build: Updating dependencies 2021-07-22 03:36:05 +00:00
json JsonCodec: Fix test 2021-12-09 19:28:30 -08:00
language Use LanguageNameUtils constants instead of strings 2021-12-05 22:13:34 +01:00
libs MapCacheLRU: Restore key type checks 2022-01-21 15:22:32 +11:00
linker Add comment flag to LinkRenderer 2021-11-02 13:03:20 +01:00
mail Make MailAddressTest a unit test 2021-07-23 10:30:04 +00:00
media Replace new stdClass with more compact array syntax 2021-11-02 09:43:03 +00:00
Message Convert ConverterTest to pure unit tests 2021-03-22 15:59:42 +00:00
objectcache build: Updating dependencies 2021-07-22 03:36:05 +00:00
page DeletePage: add option to delete the associated talk page 2022-01-11 14:48:56 +01:00
ParamValidator/TypeDef Make UserDefTest a unit test 2021-09-13 23:55:51 -04:00
parser Merge "Make Sanitizer::stripAllTags() strip css and js tag contents" 2021-12-23 12:44:22 +00:00
password Remove or replace usages of "sanity" 2021-11-21 16:42:31 +00:00
Permissions Support having groups inherit permissions from another group 2021-12-04 12:45:23 -08:00
poolcounter phpunit: Mass-replace setMethods with onlyMethods and adjust 2021-04-16 20:15:00 +02:00
preferences Hard deprecate TitleFactory::newFromIDs and Title::newFromIDs 2021-11-29 14:23:26 -05:00
registration Cleanup mixed space/tab line indent 2021-09-04 00:52:31 +02:00
resourceloader Upgrade Vue to the migration build of Vue 3 2021-12-07 19:31:43 +00:00
Rest Merge "File: remove deprecated methods" 2021-11-05 15:17:46 +00:00
Revision Revision: Inject local cache to RevisionStore 2021-12-17 19:23:19 +01:00
revisionlist
search phpunit: Mass-replace setMethods with onlyMethods and adjust 2021-04-16 20:15:00 +02:00
session Move CRSF token generation to CsrfTokenSet 2021-06-18 12:24:19 -07:00
Settings Support stale cached settings for failover 2022-01-21 13:31:09 -08:00
shell ShellboxClientFactory: add RPCClient getters 2021-11-05 16:41:22 +00:00
site Convert MediaWikiPageNameNormalizerTest to a pure unit test 2021-03-11 18:45:57 +00:00
skins Replace new stdClass with more compact array syntax 2021-11-02 09:43:03 +00:00
Storage Introduced PreparedUpdate to replace PreparedEdit 2021-12-20 21:19:52 +01:00
tidy tests/phpunit/unit/includes/tidy/html5lib-tests.json: Avoid use of 'insanely' in comments 2021-11-24 11:46:36 +00:00
title build: Upgrade mediawiki-codesniffer from v35.0.0 to v36.0.0 2021-04-29 13:00:15 -07:00
user rdbms: Add more return typehints 2021-09-07 08:23:36 +00:00
utils build: Updating dependencies 2021-07-22 03:36:05 +00:00
watcheditem watcheditem: Try getting the cached version in resetNotificationTimestamp 2022-01-13 11:58:34 +00:00
watchlist Add DummyServicesTrait::getDummyReadOnlyMode() 2021-07-05 07:16:13 +00:00
BadFileLookupTest.php Use DummyServicesTrait for BadFileLookupTest TitleParser 2021-07-28 20:50:20 +00:00
DeprecatedGlobalTest.php build: Updating dependencies 2021-07-22 03:36:05 +00:00
DerivativeRequestTest.php
FactoryArgTestTrait.php Remove some more comments that literally repeat the code 2021-06-18 21:23:56 +00:00
FauxResponseTest.php build: Updating dependencies 2021-07-22 03:36:05 +00:00
FeedUtilsTest.php
FormOptionsInitializationTest.php build: Updating dependencies 2021-07-22 03:36:05 +00:00
FormOptionsTest.php
HeaderCallbackTest.php
LicensesTest.php
ListToggleTest.php Remove meaningless ->expects( $this->any() ) from all tests 2021-04-23 11:58:58 +02:00
MovePageTest.php build: Upgrade mediawiki-codesniffer from v35.0.0 to v36.0.0 2021-04-29 13:00:15 -07:00
PathRouterTest.php Cleanup mixed space/tab line indent 2021-09-04 00:52:31 +02:00
PingbackTest.php rdbms: Add more return typehints 2021-09-07 08:23:36 +00:00
ProxyLookupTest.php Add tests for ProxyLookup 2021-03-31 00:21:24 +00:00
ReadOnlyModeTest.php phpunit: Remove file_exists check from ReadOnlyModeTest 2021-09-11 18:22:16 +00:00
SiteConfigurationTest.php SiteConfiguration: Don't pass null to str_replace() 2022-01-11 14:42:50 +01:00
TitleArrayFromResultTest.php Stop accessing members of the Title class publicly 2021-11-22 14:22:51 +00:00
TitleTest.php tests: Avoid trying to access the DB in data providers 2021-09-20 10:32:45 +01:00
WikiReferenceTest.php Move WikiReferenceTest to a unit test 2021-05-02 10:00:52 +00:00
XmlJsTest.php
XmlSelectTest.php
XmlTest.php Move Xml::expandAttributes tests to unit tests 2021-03-07 19:27:11 +00:00