hoo added a comment.

  This problem occurs because `SetAliasesTest` uses two `User` instances 
referring to the same user with different configurations 
(`$this->createUserWithGroup( 'no-permission' )` and 
`$this->createUserWithGroup( 'all-permission' )` which both act on the user 
"Apitesteditor", see  `WikibaseApiTestCase::createTestUser` and 
`SetAliasesTest::createUserWithGroup`). This bug didn't always surface because 
this is only an issue if either `User::clearInstanceCache` is being called on 
`$userWithInsufficientPermissions` (which AFAICT will never happen) or if 
`User::load` (called in `TestUser::__construct`) chooses to load the data from 
cache (which never seems to happen for me, but I was able to force this… but I 
think this is likely to happen in certain setups).
  
  Long story short: In order to fix this, the test should either use two 
different users for testing or make sure the caches are properly cleaned out 
between test runs.

TASK DETAIL
  https://phabricator.wikimedia.org/T218378

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: hoo
Cc: WMDE-leszek, Umherirrender, Smalyshev, gerritbot, TerraCodes, 
Liuxinyu970226, cscott, Jdforrester-WMF, D3r1ck01, Aklapper, Krinkle, 
alaa_wmde, joker88john, CucyNoiD, Nandana, NebulousIris, Gaboe420, Versusxo, 
Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, Lahi, Gq86, Baloch007, 
Darkminds3113, Bsandipan, Lordiis, GoranSMilovanovic, Adik2382, Th3d3v1ls, 
Ramalepe, Liugev6, QZanden, LawExplorer, Lewizho99, Maathavan, _jensen, 
rosalieper, Jonas, Wikidata-bugs, aude, Lydia_Pintscher, Mbch331, Jay8g, Krenair
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to