ArthurTaylor added a comment.

  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 
  ).

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

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

To: ArthurTaylor
Cc: Reedy, Lucas_Werkmeister_WMDE, Aklapper, ArthurTaylor, 
Danny_Benjafield_WMDE, Isabelladantes1983, Themindcoder, Adamm71, S8321414, 
Jersione, Hellket777, LisafBia6531, Astuthiodit_1, 786, Biggs657, 
karapayneWMDE, Invadibot, maantietaja, Juan90264, Alter-paule, Beast1978, 
ItamarWMDE, Un1tY, Akuckartz, Hook696, Kent7301, joker88john, CucyNoiD, 
Nandana, Gaboe420, Giuliamocci, Cpaulf30, Lahi, Gq86, Af420, Bsandipan, 
GoranSMilovanovic, RazeSoldier, Mahir256, QZanden, KimKelting, LawExplorer, 
Lewizho99, Maathavan, _jensen, rosalieper, Neuronton, Scott_WUaS, 
Wikidata-bugs, aude, Jdforrester-WMF, Mbch331
_______________________________________________
Wikidata-bugs mailing list -- wikidata-bugs@lists.wikimedia.org
To unsubscribe send an email to wikidata-bugs-le...@lists.wikimedia.org

Reply via email to