Page MenuHomePhabricator

PageTriage ArticleMetadataTest::testValidatePageIds failing
Closed, ResolvedPublic

Description

https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php72-docker/62473/console

03:21:22 Failed asserting that two arrays are equal.
03:21:22 --- Expected
03:21:22 +++ Actual
03:21:22 @@ @@
03:21:22  Array (
03:21:22 -    0 => 2
03:21:22 -    1 => 3
03:21:22 -    2 => 4
03:21:22 -    3 => 5
03:21:22 -    4 => 6
03:21:22 -    5 => 7
03:21:22  )
03:21:22 
03:21:22 /workspace/src/tests/phpunit/MediaWikiTestCaseTrait.php:122
03:21:22 /workspace/src/extensions/PageTriage/tests/phpunit/ArticleMetadataTest.php:91
03:21:22 /workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:424
03:21:22 /workspace/src/maintenance/doMaintenance.php:105

The immediate cause is that the test assumes that the starting $this->pageIds are all valid, which is not the case

Event Timeline

Reedy created this task.Apr 20 2020, 2:26 AM
Restricted Application added a project: Growth-Team. · View Herald TranscriptApr 20 2020, 2:26 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Krinkle triaged this task as High priority.EditedApr 30 2020, 8:52 PM
Krinkle added a subscriber: Krinkle.

This is preventing merges or deploys for a production extension. (results)

This is happening because validatePageIds caches its results, but it's also called from the LinksUpdateComplete hook (and the ORESCheckModels hook, too) during page creation. The test suite's setup process creates a bunch of pages, then adds them to the PageTriage queue. But because validatePageIds is called during page creation, when the page isn't yet in the queue, the fact that it's not in the queue is cached, and validatePageIds rejects basically all of its input (except for page ID 1, for some reason).

Change 593644 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/PageTriage@master] ArticleMetadataTest: Clear static cache during setup

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

Change 593644 merged by Jforrester:
[mediawiki/extensions/PageTriage@master] ArticleMetadataTest: Clear static cache during setup

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

Jdforrester-WMF closed this task as Resolved.May 1 2020, 1:04 AM
Jdforrester-WMF assigned this task to Catrope.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

Thank you!