Discovered in https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/TheWikipediaLibrary/+/543233/, with a little bit of investigation.
This is an example:
1) CentralAuthIdLookupTest::testCentralIdFromLocalUser with data set #0 ('GlobalUser', 1001, true)
=== Logs generated by test case
[wfDebug] [debug] User: loading options for user 4 from database. {"private":false}
[GlobalTitleFail] [info] RequestContext::getTitle called by Hooks::run/Hooks::callHook/GlobalPreferences\Hooks::onUserSaveOptions/GlobalPreferences\GlobalPreferencesFactory->onGlobalPrefsPage/RequestContext->getTitle with no title set. {"private":false}
[wfDebug] [debug] User: loading options for user 5 from database. {"private":false}
[GlobalTitleFail] [info] RequestContext::getTitle called by Hooks::run/Hooks::callHook/GlobalPreferences\Hooks::onUserSaveOptions/GlobalPreferences\GlobalPreferencesFactory->onGlobalPrefsPage/RequestContext->getTitle with no title set. {"private":false}
[wfDebug] [debug] User: loading options for user 6 from database. {"private":false}
[GlobalTitleFail] [info] RequestContext::getTitle called by Hooks::run/Hooks::callHook/GlobalPreferences\Hooks::onUserSaveOptions/GlobalPreferences\GlobalPreferencesFactory->onGlobalPrefsPage/RequestContext->getTitle with no title set. {"private":false}
[localisation] [debug] LocalisationCache: using store LCStoreNull []
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
===
Failed asserting that 0 is identical to 1001.
/workspace/src/extensions/CentralAuth/tests/phpunit/CentralAuthIdLookupTest.php:160
/workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:456
/workspace/src/maintenance/doMaintenance.php:99I've investigated locally, and the culprit seems to be GlobalPreferencesHooks::onUserLoadOptions (which gets called when editing a page). The first thing the method does is:
$globalPreferences = self::getPreferencesFactory( $user ); $globalPreferences->isUserGlobalized()
and that is somehow causing the error on its own (I've stopped my investigation here).