AbuseFilterConsequencesTest is sensitive to stale state in cached Title objects because it relies on Title::newFromTextThrow() which usues a static cache of Title instances. This can cause test failures if a hook handler from another extension also called Title::newFromText() for the same title, causing the title object to be put into the static cache.
Original report
Seen on unrelated patches in CheckUser just now:
https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php81/14271/consoleFull
There were 11 failures:
09:17:37
09:17:37 1) AbuseFilterConsequencesTest::testFilterConsequences with data set "Check that all tags are applied" (array(5), array('edit', 'User:UTSysop', 'Hey.', 'I am a very nice user, really!', ''), array(array(5)))
09:17:37 Expected the action to have the following tags: firstTag, secondTag. Got the following instead: .
09:17:37
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:710
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:797
Logs generated by test
09:17:37
09:17:37 2) AbuseFilterConsequencesTest::testFilterConsequences with data set "Check that throttled filters only execute "safe" actions" (array(10), array('edit', 'Buffalo', 'Buffalo', 'Buffalo buffalo Buffalo buffa...ffalo.', 'Buffalo!'), array(array(10)))
09:17:37 Expected the action to have the following tags: testTag. Got the following instead: .
09:17:37
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:710
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:797
Logs generated by test
09:17:37
09:17:37 3) AbuseFilterConsequencesTest::testFilterConsequences with data set "Check that every throttled filter only executes "safe" actions" (array(10, 13), array('edit', 'Tyger! Tyger! Burning bright', 'In the forests of the night', 'What immortal hand or eye', 'Could frame thy fearful symmetry?'), array(array(10)))
09:17:37 Expected the action to have the following tags: testTag. Got the following instead: .
09:17:37
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:710
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:797
Logs generated by test
09:17:37
09:17:37 4) AbuseFilterConsequencesTest::testStashedEdit with data set #2 ('miss', array(5), array('User:UTSysop', 'Hey.', 'I am a very nice user, really!', ''), array(array(5)))
09:17:37 Expected the action to have the following tags: firstTag, secondTag. Got the following instead: .
09:17:37
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:710
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:1363
Logs generated by test
09:17:37
09:17:37 5) AbuseFilterConsequencesTest::testStashedEdit with data set #3 ('hit', array(5), array('User:UTSysop', 'Hey.', 'I am a very nice user, really!', ''), array(array(5)))
09:17:37 Expected the action to have the following tags: firstTag, secondTag. Got the following instead: .
09:17:37
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:710
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:1363
Logs generated by test
09:17:37
09:17:37 6) AbuseFilterConsequencesTest::testStashedEdit with data set #10 ('miss', array(10), array('Buffalo', 'Buffalo', 'Buffalo buffalo Buffalo buffa...ffalo.', 'Buffalo!'), array(array(10)))
09:17:37 Expected the action to have the following tags: testTag. Got the following instead: .
09:17:37
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:710
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:1363
Logs generated by test
09:17:37
09:17:37 7) AbuseFilterConsequencesTest::testStashedEdit with data set #11 ('hit', array(10), array('Buffalo', 'Buffalo', 'Buffalo buffalo Buffalo buffa...ffalo.', 'Buffalo!'), array(array(10)))
09:17:37 Expected the action to have the following tags: testTag. Got the following instead: .
09:17:37
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:710
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:1363
Logs generated by test
09:17:37
09:17:37 8) AbuseFilterConsequencesTest::testStashedEdit with data set #14 ('miss', array(10, 13), array('Tyger! Tyger! Burning bright', 'In the forests of the night', 'What immortal hand or eye', 'Could frame thy fearful symmetry?'), array(array(10)))
09:17:37 Expected the action to have the following tags: testTag. Got the following instead: .
09:17:37
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:710
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:1363
Logs generated by test
09:17:37
09:17:37 9) AbuseFilterConsequencesTest::testStashedEdit with data set #15 ('hit', array(10, 13), array('Tyger! Tyger! Burning bright', 'In the forests of the night', 'What immortal hand or eye', 'Could frame thy fearful symmetry?'), array(array(10)))
09:17:37 Expected the action to have the following tags: testTag. Got the following instead: .
09:17:37
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:710
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:1363
Logs generated by test
09:17:37
09:17:37 10) AbuseFilterConsequencesTest::testGlobalFilters with data set #1 (array(19), array('edit', 'A global page', 'Foo', 'Bar', 'Baz'), array(array(19)))
09:17:37 Expected the action to have the following tags: globalTag. Got the following instead: .
09:17:37
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:710
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:1499
Logs generated by test
09:17:37
09:17:37 11) AbuseFilterConsequencesTest::testGlobalFilters with data set #4 (array(19), array('stashedit', 'Cellar door', '', 'Too many doors', '', 'hit'), array(array(19)))
09:17:37 Expected the action to have the following tags: globalTag. Got the following instead: .
09:17:37
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:710
09:17:37 /workspace/src/extensions/AbuseFilter/tests/phpunit/AbuseFilterConsequencesTest.php:1499
Logs generated by test
09:17:37
09:17:37 FAILURES!
09:17:37 Tests: 931, Assertions: 3702, Failures: 11.