Page MenuHomePhabricator

ArticleRevisionVisibilitySetHookHandlerTest fails on CI
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:

  • upload a new patch

https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/618703
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/578298

shows the same errors.

Actual Results:

11:10:21 There were 6 failures:
11:10:21 
11:10:21 1) Wikibase\Repo\Tests\Hooks\ArticleRevisionVisibilitySetHookHandlerTest::testHandle with data set "One job with one revision identifier dispatched" (array(array('[{"arrayFormatVersion":1,"ent...":24}]', 1)), array(12), array(array(1, 0)))
11:10:21 Failed asserting that 0 is identical to 2.
11:10:21 
11:10:21 /workspace/src/extensions/Wikibase/repo/tests/phpunit/includes/Hooks/ArticleRevisionVisibilitySetHookHandlerTest.php:220
11:10:21 /workspace/src/maintenance/doMaintenance.php:107
11:10:21 
11:10:21 2) Wikibase\Repo\Tests\Hooks\ArticleRevisionVisibilitySetHookHandlerTest::testHandle with data set "One job with two revision identifiers dispatched" (array(array('[{"arrayFormatVersion":1,"ent...":25}]', 1)), array(12, 13), array(array(1, 0), array(1, 474)))
11:10:21 Failed asserting that 0 is identical to 2.
11:10:21 
11:10:21 /workspace/src/extensions/Wikibase/repo/tests/phpunit/includes/Hooks/ArticleRevisionVisibilitySetHookHandlerTest.php:220
11:10:21 /workspace/src/maintenance/doMaintenance.php:107
11:10:21 
11:10:21 3) Wikibase\Repo\Tests\Hooks\ArticleRevisionVisibilitySetHookHandlerTest::testHandle with data set "Two jobs dispatched (different bit flags)" (array(array('[{"arrayFormatVersion":1,"ent...":24}]', 1), array('[{"arrayFormatVersion":1,"ent...":25}]', 6)), array(12, 13), array(array(1, 0), array(6, 2)))
11:10:21 Failed asserting that 0 is identical to 2.
11:10:21 
11:10:21 /workspace/src/extensions/Wikibase/repo/tests/phpunit/includes/Hooks/ArticleRevisionVisibilitySetHookHandlerTest.php:220
11:10:21 /workspace/src/maintenance/doMaintenance.php:107
11:10:21 
11:10:21 4) Wikibase\Repo\Tests\Hooks\ArticleRevisionVisibilitySetHookHandlerTest::testHandle with data set "Two jobs dispatched (small batch size)" (array(array('[{"arrayFormatVersion":1,"ent...":25}]', 1), array('[{"arrayFormatVersion":1,"ent...":26}]', 1)), array(12, 13, 14), array(array(1, 0), array(1, 2), array(1, 99)), true, 2)
11:10:21 Failed asserting that 0 is identical to 2.
11:10:21 
11:10:21 /workspace/src/extensions/Wikibase/repo/tests/phpunit/includes/Hooks/ArticleRevisionVisibilitySetHookHandlerTest.php:220
11:10:21 /workspace/src/maintenance/doMaintenance.php:107
11:10:21 
11:10:21 5) Wikibase\Repo\Tests\Hooks\ArticleRevisionVisibilitySetHookHandlerTest::testHandle with data set "Multiple jobs with multiple revisions dispatched" (array(array('[{"arrayFormatVersion":1,"ent...":26}]', 1), array('[{"arrayFormatVersion":1,"ent...":25}]', 6)), array(12, 13, 14), array(array(1, 0), array(6, 2), array(1, 99)))
11:10:21 Failed asserting that 0 is identical to 2.
11:10:21 
11:10:21 /workspace/src/extensions/Wikibase/repo/tests/phpunit/includes/Hooks/ArticleRevisionVisibilitySetHookHandlerTest.php:220
11:10:21 /workspace/src/maintenance/doMaintenance.php:107
11:10:21 
11:10:21 6) Wikibase\Repo\Tests\Hooks\ArticleRevisionVisibilitySetHookHandlerTest::testHandle with data set "One job dispatched, some revisions discarded" (array(array('[{"arrayFormatVersion":1,"ent...":24}]', 1)), array(404, 12, 408), array(array(1, 0), array(1, 0), array(1, 2)))
11:10:21 Failed asserting that 0 is identical to 2.
11:10:21 
11:10:21 /workspace/src/extensions/Wikibase/repo/tests/phpunit/includes/Hooks/ArticleRevisionVisibilitySetHookHandlerTest.php:220
11:10:21 /workspace/src/maintenance/doMaintenance.php:107
11:10:21

Expected Results:

CI should pass

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Michael triaged this task as Unbreak Now! priority.EditedAug 6 2020, 10:29 AM

This seems to be blocking the merging of the patch 618703 for the current UBN T259744 and maybe T259745, thus triaging this as Unbreak Now! as well.

Change 618740 had a related patch set uploaded (by Tobias Andersson; owner: Tobias Andersson):
[mediawiki/extensions/Wikibase@master] Test if this fixes CI

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

Had a quick chat with @toan - we are looking into this for a little longer (around 30mins) and will consider alternative steps to unblock CI should we not find a solution.

Change 618772 had a related patch set uploaded (by Pablo Grass (WMDE); owner: Pablo Grass (WMDE)):
[mediawiki/extensions/Wikibase@master] temporarily disable ArticleRevisionVisibilitySetHookHandlerTest

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

https://gerrit.wikimedia.org/r/618772 temporarily disables the tests to unblock unrelated work. We will keep full focus on the topic tomorrow.

Observation:

The data provider specified for Wikibase\Lib\Tests\Store\Sql\SqlChangeStoreTest::testSaveChange_insert is invalid.
Error: Call to undefined method Wikibase\Lib\Changes\ItemChange::setMetadataFromRC()
/workspace/src/extensions/Wikibase/lib/tests/phpunit/Store/Sql/SqlChangeStoreTest.php:58

caught my eye but also happens in green runs.

Change 618772 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] temporarily disable ArticleRevisionVisibilitySetHookHandlerTest

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

Pablo-WMDE lowered the priority of this task from Unbreak Now! to High.Aug 6 2020, 4:31 PM

Patch with disabled test is merged.

Change 618785 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/core@master] Clean up test fake time singleton to fix Wikibase tests

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

Change 618774 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/Wikibase@master] Reenable ArticleRevisionVisibilitySetHookHandlerTest

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

Observation:

The data provider specified for Wikibase\Lib\Tests\Store\Sql\SqlChangeStoreTest::testSaveChange_insert is invalid.
Error: Call to undefined method Wikibase\Lib\Changes\ItemChange::setMetadataFromRC()
/workspace/src/extensions/Wikibase/lib/tests/phpunit/Store/Sql/SqlChangeStoreTest.php:58

caught my eye but also happens in green runs.

Tracked as T259814.

Error: Call to undefined method Wikibase\Lib\Changes\ItemChange::setMetadataFromRC()

Tracked as T259814.

Thank you!

Change 618742 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/core@master] Clean up test static fake time to fix Wikibase tests

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

Change 618785 abandoned by Michael Große:
[mediawiki/core@master] Clean up test fake time singleton to fix Wikibase tests

Reason:
I5430f4dee02216b5d5f48c3b2810f111362f3c4e is the original patch and the one that should be merged.

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

Change 618740 abandoned by Tobias Andersson:
[mediawiki/extensions/Wikibase@master] Test if this fixes CI

Reason:
Work happening in https://gerrit.wikimedia.org/r/c/618774

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

Change 618925 had a related patch set uploaded (by Pablo Grass (WMDE); owner: Pablo Grass (WMDE)):
[mediawiki/core@master] UserDefTest: prevent (time) sideeffect from dataProvider

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

There are two competing patches to be able to re-enable our test,
https://gerrit.wikimedia.org/r/618925 & https://gerrit.wikimedia.org/r/618949 - the original author, @nnikkhoui, is pinged on the patches to kindly advise.

Once one of them is merged, our test should be re-enabled! (c.f. https://gerrit.wikimedia.org/r/618774)

Change 618949 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/core@master] Remove stray fake time side effect in data provider

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

Change 618925 abandoned by Pablo Grass (WMDE):
[mediawiki/core@master] UserDefTest: prevent (time) sideeffect from dataProvider

Reason:
I0df26d6af56ed18eac836929fd469b4a637d4902 was merged instead, which goes one step further.

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

Change 618949 merged by jenkins-bot:
[mediawiki/core@master] Remove stray fake time side effect in data provider

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

Change 618774 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Reenable ArticleRevisionVisibilitySetHookHandlerTest

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

Change 618742 abandoned by Tobias Andersson:
[mediawiki/core@master] Clean up test static fake time to fix Wikibase tests

Reason:
Solution was to just remove the faketime. already solved.

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

Apologies everyone for being the one to merge that in and block CI. It was a big miss on my end. I had needed the fake timestamp (still should definitely not have been in the data provider to begin with). But around the same time another patch was merged that caused me not to need the faketimestamp (https://gerrit.wikimedia.org/r/c/mediawiki/core/+/616120) so removing it is definitely the better solution of the two. Thank you very much for catching it and working to merge in the fix, I hadn't seen this until Petr +2ed the fix patch.