Page MenuHomePhabricator

Failing Wikibase InfoAction tests block CI
Closed, ResolvedPublicBUG REPORT

Description

I really have no idea what's going on. Neither the failing InfoActionHookHandlerTest nor anything related to core's InfoAction was touched the past months and years.

Example for a blocked patch: https://gerrit.wikimedia.org/r/1017918
Console output: https://integration.wikimedia.org/ci/job/wmf-quibble-vendor-mysql-php81/133/console

08:40:13 4) Wikibase\Client\Tests\Unit\Hooks\InfoActionHookHandlerTest::testOnInfoAction with data set #0 (array(array(array('TestWiki item ID', '<a href="https://www.wikidata...Q4</a>')), array(array('TestWiki entities used in this page', '<ul><li><a href="https://www....></ul>'))), MediaWiki\Context\RequestContext Object (...), array(array()), true, Wikibase\DataModel\Entity\ItemId Object (...), null, null, 'item id link')
08:40:13 item id link
08:40:13 Failed asserting that two arrays are equal.
08:40:13 --- Expected
08:40:13 +++ Actual
08:40:13 @@ @@
08:40:13  Array (
08:40:13      'header-basic' => Array (
08:40:13          0 => Array (
08:40:13 -            0 => 'TestWiki item ID'
08:40:13 +            0 => '{{WBREPONAME}} item ID'
08:40:13              1 => '<a href="https://www.wikidata...Q4</a>'
08:40:13          )
08:40:13      )
08:40:13      'header-properties' => Array (
08:40:13          0 => Array (
08:40:13 -            0 => 'TestWiki entities used in this page'
08:40:13 +            0 => '{{WBREPONAME}} entities used in this page'
08:40:13              1 => '<ul><li><a href="https://www....></ul>'
08:40:13          )
08:40:13      )
08:40:13  )

Event Timeline

thiemowmde triaged this task as Unbreak Now! priority.Apr 15 2024, 7:23 AM

{{WBREPONAME}} is a custom magic word that comes with Wikibase. The test results make it look like it just stopped working. I have no idea why. Especially why only a few WikibaseClient tests fail.

I know this is not really an unbreak now as it's apparently (at least I hope) not about production but "only" tests. Unfortunately issues like this are seemingly becoming the norm recently in my working area (T362383 was just 1 workday ago), which is getting exhausting.

Locally, git bisect says the first bad commit is Deprecate use of dynamic properties attached to Parser (T343227). However, it fails with an error Use of MediaWiki\Parser\Parser::$extCite was deprecated in MediaWiki 1.42. that I don’t see in the linked CI output.

Scratch all that, my Cite was just outdated. After updating it I can’t reproduce the error anymore.

But based on that, and the CI output, it feels like some deprecation warning happens (in CI, it’s “strtolower(): Passing null to parameter #1 ($string) of type string is deprecated”, from when a Message is stringified; locally, it was from Cite), and this somehow makes the InfoActionHookHandlerTest fail later? Perhaps the message cache gets corrupted somehow and causes the WBREPONAME magic word to be missing?

Yeah, I think the other test failure in the linked CI build (“Expectation failed for method name is "addCategory" when invoked 1 time(s).”) also would make some sense with a broken message cache – in that case, TrackingCategories might resolve the tracking category to an empty / disabled category, and therefore not call addCategory() on the ParserOutput.

Change #1019691 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] DataBridgeReferenceFormatter: Use message as text

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

Change #1019691 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] DataBridgeReferenceFormatter: Use message as text

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

This doesn’t really address the root cause, but I think it’s a good idea in general and could still help here.

Change #1019691 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] DataBridgeReferenceFormatter: Use message as text

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

Change #1020204 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/FileImporter@master] Use upstream createNoOpMock in tests wherever possible

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

Change #1020206 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/FileImporter@master] Use upstream getMockMessage in tests where possible

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

Is this still an UBN? I’m not really sure how the above two patches relate to this.

thiemowmde lowered the priority of this task from Unbreak Now! to Needs Triage.Apr 16 2024, 3:13 PM

Thanks a lot for looking into this! So far it really looks like some state makes it from one test to the next – but where exactly this happens we don't know, or do we? The linked patches are attempts to make some of the involved test setups more robust.

Change #1020268 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/FileImporter@master] Turn plain PHPUnit tests into MediaWikiIntegrationTestCase

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

Change #1020268 merged by jenkins-bot:

[mediawiki/extensions/FileImporter@master] Turn plain PHPUnit tests into MediaWikiIntegrationTestCase

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

Change #1020204 merged by jenkins-bot:

[mediawiki/extensions/FileImporter@master] Use upstream createNoOpMock in tests wherever possible

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

Change #1020206 abandoned by Thiemo Kreuz (WMDE):

[mediawiki/extensions/FileImporter@master] Use upstream getMockMessage in tests where possible

Reason:

Already did this twice, see Iebb595d.

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