Page MenuHomePhabricator

[LEX] Investigate Wikibase CI failures on REL1_39 branch
Closed, ResolvedPublic

Description

CI on REL1_39 for Wikibase has been broken for a while (see T356896). Now that it's fixed, we can see that there have been some actual failures related to entity redirects:

14:58:09 1) Wikibase\Lexeme\Tests\MediaWiki\Api\MergeLexemesTest::testGivenSuccessfulMerge_respondsWithSuccessMessage
14:58:09 ApiUsageException: Entity L2 is a redirect
14:58:09 2) Wikibase\Lexeme\Tests\MediaWiki\Api\MergeLexemesTest::testCustomSummaryUse
14:58:09 ApiUsageException: Entity L321 is a redirect
14:58:09 3) Wikibase\Lexeme\Tests\MediaWiki\Api\MergeLexemesTest::testMergesLexemesWithTags
14:58:09 ApiUsageException: Entity L2 is a redirect
14:58:09 4) Wikibase\Lexeme\Tests\MediaWiki\Specials\SpecialMergeLexemesTest::testGivenMergeSucceeds_showsSuccessMessage
14:58:09 Wikibase\Repo\Interactors\RedirectCreationException: Entity L2 is a redirect

(see full log). Investigate and fix these errors.

  • CI for Wikibase on REL1_39 is passing

Event Timeline

Lucas_Werkmeister_WMDE renamed this task from Investigate Wikibase CI failures on REL1_39 branch to [LEX] Investigate Wikibase CI failures on REL1_39 branch.Mar 26 2024, 10:52 AM

Prio Notes:

Impact AreaAffected
production / end users
monitoring
development efforts
onboarding efforts
additional stakeholders

This is blocking merges to Math...

I see Arthur claimed this today, so should we expect a patch (whether fixing, or just skipping the tests) soon? :)

Yeah - I was investigating yesterday and will spend some more time today. It's a bit of a weird one. If I can't get to the bottom of it, I'll skip these tests. I'm somewhat confident that this is a quirk of the test suite rather than a bug in the functionality.

Change #1018203 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[mediawiki/extensions/PropertySuggester@REL1_39] Revert changes to `redirect` table after test runs

https://gerrit.wikimedia.org/r/1018203

Change #1018203 merged by jenkins-bot:

[mediawiki/extensions/PropertySuggester@REL1_39] Revert changes to `redirect` table after test runs

https://gerrit.wikimedia.org/r/1018203

This seems to be fixed now. Was definitely a bit of a weird one. It's not clear to me why the call to $this->entityRedirectLookup->getRedirectForEntityId(..) in EntityRedirectCreationInteractor.php was finding a redirect to the second Item inserted in GetSuggestionsTest.php. Single-stepping the code, the Lexeme tests were hitting the real database (no mocked / modified / wrapped lookup services), and the debug log showed that the correct query was being run:

SELECT  page_id,rd_namespace,rd_title  FROM `unittest_page` LEFT JOIN `unittest_redirect` ON ((rd_from=page_id)) WHERE page_title = 'L2' AND page_namespace = 146  LIMIT 1

Randomising the Lexeme ID numbers, or changing the Item ID numbers had no effect - the Lexemes would always find the redirects to exactly that second item. Running the Lexeme tests on their own didn't trigger the issue, and running just the GetSuggestionsTest and the MergeLexemesTest together wasn't enough to trigger the issue, so there may be some other interactions involved there too.

In the end, I was able to track down the source of the issue by changing every Q2 in the codebase to something other than Q2 and running the test suite under a debugger to read out the target of the redirect (thanks for the inspiration @Lucas_Werkmeister_WMDE
).