Page MenuHomePhabricator

Cognate data is not restored (any more) on page undeletion
Closed, ResolvedPublic

Description

I did a "git bisect" and tracked the issue down to this change: https://gerrit.wikimedia.org/r/501594 (T188327). Since then, the test case CognateIntegrationTest::testCreateDeleteAndRestorePageResultsInEntry fails. What this test case does is deleting and undeleting a page, and then checking if the information in the Cognate database is undeleted as well. It appears either the information is lost, or the test setup is incomplete.

Example for a test failure: https://gerrit.wikimedia.org/r/505310

13:52:55 1) Cognate\Tests\CacheInvalidatorTest::testJobIsQueued
13:52:55 Failed asserting that two variables reference the same object.
13:52:55 
13:52:55 /workspace/src/extensions/Cognate/tests/phpunit/CacheInvalidatorTest.php:34
13:52:55 /workspace/src/extensions/Cognate/src/CacheInvalidator.php:30
13:52:55 /workspace/src/extensions/Cognate/tests/phpunit/CacheInvalidatorTest.php:38
13:52:55 /workspace/src/tests/phpunit/MediaWikiTestCase.php:427
13:52:55 /workspace/src/maintenance/doMaintenance.php:96

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 24 2019, 9:04 AM
thiemowmde triaged this task as High priority.Apr 24 2019, 9:04 AM
kchapman lowered the priority of this task from High to Normal.Apr 26 2019, 3:27 PM
kchapman added a subscriber: kchapman.

@Anomie could you investigate if this is a core issue?

@Lydia_Pintscher is this something you all are planning to work on?

I would prefer not to if we didn't cause it but it needs to be fixed soon. So if necessary yes.

daniel added a subscriber: daniel.May 2 2019, 2:17 PM

@Anomie do you have an idea what might be going on here?

daniel updated the task description. (Show Details)May 2 2019, 2:18 PM

Change 507922 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/Cognate@master] Fix all broken unit and Phan tests

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

FYI, I found a way to fix the broken test. The issue seems to be that the test cases all use the same page. The second last test moves the page and turns it into a redirect. The last test tries to delete and restore the page, but restores the redirect instead. By making the tests independent from each other the issue disappears.

To PM: I believe this is not a production-relevant bug, and does not cause data-loss.

However: I can not explain why the change https://gerrit.wikimedia.org/r/501594 made the test fail. It should have failed before as well! This might be worth further investigation.

Change 507922 merged by jenkins-bot:
[mediawiki/extensions/Cognate@master] Fix all broken unit and Phan tests

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

Addshore closed this task as Resolved.May 13 2019, 11:32 PM
Addshore claimed this task.

Looking at the patch that was merged, I think we can close this, as it indeed looks like it was just a test issue.

Restricted Application added a project: User-Addshore. · View Herald TranscriptMay 13 2019, 11:32 PM