Page MenuHomePhabricator

Flaky unit test Flow RevisionCollectionPermissionsTest::testPermissions
Open, Needs TriagePublic

Description

Reported by @Umherirrender at https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/NavigationTiming/+/466234/

https://integration.wikimedia.org/ci/job/wmf-quibble-vendor-mysql-php70-docker/2273/console

There was 1 failure:

1) Flow\Tests\Collection\RevisionCollectionPermissionsTest::testPermissions with data set #4 ('confirmedUser', 'history', array(array(false), array(false)))
User UTFlowConfirmed should not be allowed action history on revision new-post : new-post:false suppress-post:false : {"rev_id":"umjdaz7573t9iz5b","rev_user_id":1,"rev_user_ip":null,"rev_user_wiki":"wikidb-unittest_","rev_parent_id":null,"rev_change_type":"new-post","rev_type":"post","rev_type_id":"umjdaz7571u8ex67","rev_content":"test content","rev_content_url":null,"rev_flags":"html","rev_mod_state":"","rev_mod_user_id":null,"rev_mod_user_ip":null,"rev_mod_user_wiki":null,"rev_mod_timestamp":null,"rev_mod_reason":null,"rev_last_edit_id":null,"rev_edit_user_id":null,"rev_edit_user_ip":null,"rev_edit_user_wiki":null,"rev_content_length":0,"rev_previous_content_length":0,"tree_parent_id":null,"tree_rev_descendant_id":"umjdaz7571u8ex67","tree_rev_id":"umjdaz7573t9iz5b","tree_orig_user_id":1,"tree_orig_user_ip":null,"tree_orig_user_wiki":"wikidb-unittest_"}
Failed asserting that true matches expected false.

/workspace/src/extensions/Flow/tests/phpunit/Collection/RevisionCollectionPermissionsTest.php:200

Maybe related:

Event Timeline

Krinkle created this task.Oct 13 2018, 10:03 PM
Restricted Application added a project: Growth-Team. · View Herald TranscriptOct 13 2018, 10:03 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Krinkle updated the task description. (Show Details)Oct 13 2018, 10:05 PM

Also happened with ContentTranslation: https://integration.wikimedia.org/ci/job/wmf-quibble-vendor-mysql-hhvm-docker/8018/console

There was 1 error:

1) Flow\Tests\Api\ApiFlowModerateTopicTest::testModerateLockedTopic
Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: INSERT  INTO `unittest_flow_revision` (rev_id,rev_user_id,rev_user_ip,rev_user_wiki,rev_parent_id,rev_change_type,rev_type,rev_type_id,rev_content,rev_flags,rev_mod_state,rev_mod_user_id,rev_mod_user_ip,rev_mod_user_wiki,rev_mod_timestamp,rev_mod_reason,rev_last_edit_id,rev_edit_user_id,rev_edit_user_ip,rev_edit_user_wiki,rev_content_length,rev_previous_content_length) VALUES ('��c{#�Uu�','1',NULL,'wikidb-unittest_','��ck��Uu�','delete-topic','post','��ck��Uu�','Hi there!','utf-8,topic-title-wikitext','delete','1',NULL,'wikidb-unittest_','20181015185925','<>&{};',NULL,NULL,NULL,NULL,'0','9')
Function: Flow\Data\Storage\RevisionStorage::insert
Error: 1062 Duplicate entry '\x05\x99\xE4ck\x83\xFFUu\xA4\x1B' for key 'flow_revision_unique_parent' (/workspace/db/quibble-mysql-i50hse3z/socket)


/workspace/src/includes/libs/rdbms/database/Database.php:1496
/workspace/src/includes/libs/rdbms/database/Database.php:1466
/workspace/src/includes/libs/rdbms/database/Database.php:1226
/workspace/src/includes/libs/rdbms/database/Database.php:2068
/workspace/src/extensions/Flow/includes/Data/Storage/RevisionStorage.php:392
/workspace/src/extensions/Flow/includes/Data/ObjectManager.php:248
/workspace/src/extensions/Flow/includes/Data/ObjectManager.php:173
/workspace/src/extensions/Flow/includes/Data/ObjectManager.php:146
/workspace/src/extensions/Flow/includes/Data/ManagerGroup.php:81
/workspace/src/extensions/Flow/includes/Block/Topic.php:444
/workspace/src/extensions/Flow/includes/SubmissionHandler.php:160
/workspace/src/extensions/Flow/includes/WorkflowLoader.php:66
/workspace/src/extensions/Flow/includes/Api/ApiFlowBasePost.php:35
/workspace/src/extensions/Flow/includes/Api/ApiFlow.php:98
/workspace/src/includes/api/ApiMain.php:1587
/workspace/src/includes/api/ApiMain.php:500
/workspace/src/tests/phpunit/includes/api/ApiTestCase.php:107
/workspace/src/extensions/Flow/tests/phpunit/api/ApiTestCase.php:73
/workspace/src/extensions/Flow/tests/phpunit/api/ApiFlowModerateTopicTest.php:111
/workspace/src/tests/phpunit/MediaWikiTestCase.php:424
/workspace/src/maintenance/doMaintenance.php:94

--

There were 2 failures:

1) Flow\Tests\Collection\RevisionCollectionPermissionsTest::testPermissions with data set #5 ('confirmedUser', 'history', array(array(true), array(false), array(false)))
User UTFlowConfirmed should be allowed action history on revision new-post : new-post:true suppress-post:false restore-post:false : {"rev_id":"umnpu2by86abrpxm","rev_user_id":1,"rev_user_ip":null,"rev_user_wiki":"wikidb-unittest_","rev_parent_id":null,"rev_change_type":"new-post","rev_type":"post","rev_type_id":"umnpu2by84bannyi","rev_content":"test content","rev_content_url":null,"rev_flags":"html","rev_mod_state":"","rev_mod_user_id":null,"rev_mod_user_ip":null,"rev_mod_user_wiki":null,"rev_mod_timestamp":null,"rev_mod_reason":null,"rev_last_edit_id":null,"rev_edit_user_id":null,"rev_edit_user_ip":null,"rev_edit_user_wiki":null,"rev_content_length":0,"rev_previous_content_length":0,"tree_parent_id":null,"tree_rev_descendant_id":"umnpu2by84bannyi","tree_rev_id":"umnpu2by86abrpxm","tree_orig_user_id":1,"tree_orig_user_ip":null,"tree_orig_user_wiki":"wikidb-unittest_"}
Failed asserting that false matches expected true.

/workspace/src/extensions/Flow/tests/phpunit/Collection/RevisionCollectionPermissionsTest.php:201
/workspace/src/tests/phpunit/MediaWikiTestCase.php:424
/workspace/src/maintenance/doMaintenance.php:94

2) Flow\Tests\Api\ApiFlowViewTopicListTest::testTocOnly
TOC-only output for "newest" order
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
                     'roots' => Array (
-                        0 => 'umnpup6p8w8pf5sr'
-                        1 => 'umnpup6qsur9f6l7'
+                        0 => 'umnpup6qsur9f6l7'
+                        1 => 'umnpup6qsou630nv'
                     )
                     'posts' => Array (
-                        'umnpup6p8w8pf5sr' => Array (...)
                         'umnpup6qsur9f6l7' => Array (...)
+                        'umnpup6qsou630nv' => Array (...)
                     )
                     'revisions' => Array (
-                        'umnpup6p8y7qj7rv' => Array (...)
                         'umnpup6qswqaj8kb' => Array (...)
+                        'umnpup6qsqt772mz' => Array (...)
                     )
                     'links' => Array (
                         'pagination' => Array (
                             'fwd' => Array (
-                                'url' => '/index.php?title=Talk:Flow_QA&topiclist_offset-dir=fwd&topiclist_limit=2&topiclist_offset-id=umnpup6qsur9f6l7&topiclist_sortby=newest'
+                                'url' => '/index.php?title=Talk:Flow_QA&topiclist_offset-dir=fwd&topiclist_limit=2&topiclist_offset-id=umnpup6qsou630nv&topiclist_sortby=newest'
                                 'title' => 'fwd'
                                 'text' => 'fwd'
                             )
                         )
                     )
                     'errors' => Array ()
                     'type' => 'topiclist'
                 )
             )
             'status' => 'ok'
         )
     )
 )

/workspace/src/extensions/Flow/tests/phpunit/api/ApiFlowViewTopicListTest.php:172
/workspace/src/tests/phpunit/MediaWikiTestCase.php:424
/workspace/src/maintenance/doMaintenance.php:94

Change 472263 had a related patch set uploaded (by Kosta Harlan; owner: Kosta Harlan):
[mediawiki/extensions/Flow@master] Temporarily mark flaky tests as broken

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

Change 472263 merged by jenkins-bot:
[mediawiki/extensions/Flow@master] Temporarily mark flaky tests as broken

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

Change 472456 had a related patch set uploaded (by Kosta Harlan; owner: Kosta Harlan):
[mediawiki/extensions/Flow@REL1_32] Temporarily mark flaky tests as broken

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

JTannerWMF moved this task from FY 2019-20 to Q3 2018-19 on the Growth-Team board.Jan 3 2019, 3:54 PM
Tgr added a subscriber: Tgr.Jan 20 2019, 2:41 AM

Still flaky: https://integration.wikimedia.org/ci/job/wmf-quibble-core-vendor-mysql-hhvm-docker/7932/console

01:38:13 1) Flow\Tests\Api\ApiFlowModerateTopicTest::testModerateLockedTopic
01:38:13 Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
01:38:13 Query: INSERT  INTO `unittest_flow_revision` (rev_id,rev_user_id,rev_user_ip,rev_user_wiki,rev_parent_id,rev_change_type,rev_type,rev_type_id,rev_content,rev_flags,rev_mod_state,rev_mod_user_id,rev_mod_user_ip,rev_mod_user_wiki,rev_mod_timestamp,rev_mod_reason,rev_last_edit_id,rev_edit_user_id,rev_edit_user_ip,rev_edit_user_wiki,rev_content_length,rev_previous_content_length) VALUES ('���@��l','1',NULL,'wikidb-unittest_','���C���l','delete-topic','post','���C���l','Hi there!','utf-8,topic-title-wikitext','delete','1',NULL,'wikidb-unittest_','20190120013514','<>&{};',NULL,NULL,NULL,NULL,'0','9')
01:38:13 Function: Flow\Data\Storage\RevisionStorage::insert
01:38:13 Error: 1062 Duplicate entry '\x05\xA1\xA3\x97\x01C\xFE\xF5\x0F\xC1l' for key 'flow_revision_unique_parent' (/workspace/db/quibble-mysql-m0txa6t2/socket)

testModerateLockedTopic (also mentioned in T206929#4669481) should be marked broken as well, probably.

Some notes:

The backtrace:

02:38:13 /workspace/src/includes/libs/rdbms/database/Database.php:1506
02:38:13 /workspace/src/includes/libs/rdbms/database/Database.php:1476
02:38:13 /workspace/src/includes/libs/rdbms/database/Database.php:1236
02:38:13 /workspace/src/includes/libs/rdbms/database/Database.php:2068
02:38:13 /workspace/src/extensions/Flow/includes/Data/Storage/RevisionStorage.php:392
02:38:13 /workspace/src/extensions/Flow/includes/Data/ObjectManager.php:248
02:38:13 /workspace/src/extensions/Flow/includes/Data/ObjectManager.php:173
02:38:13 /workspace/src/extensions/Flow/includes/Data/ObjectManager.php:146
02:38:13 /workspace/src/extensions/Flow/includes/Data/ManagerGroup.php:81
02:38:13 /workspace/src/extensions/Flow/includes/Block/Topic.php:444
02:38:13 /workspace/src/extensions/Flow/includes/SubmissionHandler.php:160
02:38:13 /workspace/src/extensions/Flow/includes/WorkflowLoader.php:66
02:38:13 /workspace/src/extensions/Flow/includes/Api/ApiFlowBasePost.php:35
02:38:13 /workspace/src/extensions/Flow/includes/Api/ApiFlow.php:98
02:38:13 /workspace/src/includes/api/ApiMain.php:1596
02:38:13 /workspace/src/includes/api/ApiMain.php:500
02:38:13 /workspace/src/tests/phpunit/includes/api/ApiTestCase.php:107
02:38:13 /workspace/src/extensions/Flow/tests/phpunit/Api/ApiTestCase.php:73
02:38:13 /workspace/src/extensions/Flow/tests/phpunit/Api/ApiFlowModerateTopicTest.php:114
02:38:13 /workspace/src/tests/phpunit/MediaWikiTestCase.php:424
02:38:13 /workspace/src/maintenance/doMaintenance.php:94

On line 114, we have:

		$data = $this->doApiRequest( [
			'page' => $topic['topic-page'],
			'token' => $this->getEditToken(),
			'action' => 'flow',
			'submodule' => 'moderate-topic',
			'mtmoderationState' => AbstractRevision::MODERATED_DELETED,
			'mtreason' => '<>&{};'
		] );

But as you see in the duplicate key entry error, the param for rev_content is Hi there! which is created on line 92, when $this->createTopic(); is created.

Change 472456 abandoned by Kosta Harlan:
Temporarily mark flaky tests as broken

Reason:
No comments/activity on this so I assume it's not needed anymore.

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