We've had to add deletion steps to several of our test cases to defend against entries left over from other test cases. In Idd7f6e8a0d1f460a19cc3e072ecd6b1c35bd2fb4, a question was raised about the code that cleaned up dangling entries on setup.
I did some investigation here and it looks like there is another test case is leaving pages behind. Here's an example amendment of the test where I've stopped manually clearing out pages.
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/PageTriage/+/929784/1/tests/phpunit/MaintenanceCleanupPageTriagePageTagsTest.php
When I run the test by itself, it passes
php tests/phpunit/phpunit.php --filter 'MaintenanceCleanupPageTriagePageTagsTest'
when I run it along with all of the other tests it fails
php tests/phpunit/phpunit.php --filter PageTriage
To fix this, we should go through all the tests that are doing this defensive step and try to identify and eliminate the source of the polluted state and remove the defense against it