Page MenuHomePhabricator

Fix failing MediaWiki core tests on Postgres database backend
Open, Needs TriagePublic

Description

MediaWiki core now runs tests using postgres as an experimental job (comment "check experimental" on your patch for it to run). Once all of the current failures are fixed, we can make it voting.

29 May 2018: P7168.

27 Jun 2018 (Travis CI - postgres - errors):

There was 1 error:
1) MediaWiki\Tests\Storage\SqlBlobStoreTest::testSimpleStoreGetBlobSimpleRoundtripWindowsLegacyEncodingGzip with data set #1 ('someText')
gzinflate(): data error
/home/travis/build/wikimedia/mediawiki/includes/Storage/SqlBlobStore.php:484
/home/travis/build/wikimedia/mediawiki/includes/Storage/SqlBlobStore.php:411
/home/travis/build/wikimedia/mediawiki/includes/Storage/SqlBlobStore.php:349
/home/travis/build/wikimedia/mediawiki/includes/Storage/SqlBlobStore.php:277
/home/travis/build/wikimedia/mediawiki/includes/libs/objectcache/WANObjectCache.php:1242
/home/travis/build/wikimedia/mediawiki/includes/libs/objectcache/WANObjectCache.php:1115
/home/travis/build/wikimedia/mediawiki/includes/Storage/SqlBlobStore.php:279
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/SqlBlobStoreTest.php:249
--

27 Jun 2018 (Travis CI - postgres - failures):

There were 26 failures:
1) PageArchiveTest::testListRevisions
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'ar_minor_edit' => '0'
     'ar_user' => '0'
-    'ar_user_text' => '2600:387:ed7:947e:8c16:a1ad:dd34:1dd7'
+    'ar_user_text' => '127.0.0.1'
     'ar_actor' => null
-    'ar_len' => '11'
+    'ar_len' => '7'
     'ar_deleted' => '0'
-    'ar_rev_id' => '3'
-    'ar_sha1' => '0qdrpxl537ivfnx4gcpnzz0285yxryy'
+    'ar_rev_id' => '2'
+    'ar_sha1' => 'pr0s8e18148pxhgjfa0gjrvpy8fiyxc'
     'ar_page_id' => '2'
-    'ar_comment_text' => 'just a test'
+    'ar_comment_text' => 'testing'
     'ar_comment_data' => null
     'ar_comment_cid' => null
     'ar_content_format' => null
     'ar_content_model' => null
     'ts_tags' => null
-    'ar_id' => '2'
+    'ar_id' => '1'
     'ar_namespace' => '0'
     'ar_title' => 'PageArchiveTest_thePage'
-    'ar_text_id' => '3'
-    'ar_parent_id' => '2'
+    'ar_text_id' => '2'
+    'ar_parent_id' => '0'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/PageArchiveTest.php:175
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
2) MediaWiki\Tests\Storage\McrRevisionStoreDbTest::testInsertRevisionOn_successes with data set #0 (array(MediaWiki\Storage\SlotRecord Object (...), true, CommentStoreComment Object (...), '20171117010101', true))
row #1 mismatches
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     0 => '2'
     1 => '1'
-    2 => '2017-11-17 01:01:01 GMT'
+    2 => '2017-11-17 01:01:01+00'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:1809
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:444
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/McrRevisionStoreDbTest.php:57
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:418
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
3) MediaWiki\Tests\Storage\McrRevisionStoreDbTest::testInsertRevisionOn_successes with data set #1 (array(MediaWiki\Storage\SlotRecord Object (...), true, true, CommentStoreComment Object (...), '20171117010101', true, true, 8))
row #1 mismatches
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     0 => '2'
     1 => '1'
-    2 => '2017-11-17 01:01:01 GMT'
+    2 => '2017-11-17 01:01:01+00'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:1809
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:444
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/McrRevisionStoreDbTest.php:57
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:418
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
4) MediaWiki\Tests\Storage\McrRevisionStoreDbTest::testInsertRevisionOn_successes with data set "Multi-slot revision insertion" (array(array(WikitextContent Object (...), TextContent Object (...)), true, CommentStoreComment Object (...), '20171117010101', true))
row #1 mismatches
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     0 => '2'
     1 => '1'
-    2 => '2017-11-17 01:01:01 GMT'
+    2 => '2017-11-17 01:01:01+00'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:1809
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:444
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/McrRevisionStoreDbTest.php:57
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:418
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
5) MediaWiki\Tests\Storage\McrWriteBothRevisionStoreDbTest::testInsertRevisionOn_successes with data set "Bare minimum revision insertion" (array(MediaWiki\Storage\SlotRecord Object (...), true, CommentStoreComment Object (...), '20171117010101', true))
row #1 mismatches
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     0 => '2'
     1 => '1'
-    2 => '2017-11-17 01:01:01 GMT'
+    2 => '2017-11-17 01:01:01+00'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:1809
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:444
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/McrWriteBothRevisionStoreDbTest.php:49
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:418
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
6) MediaWiki\Tests\Storage\McrWriteBothRevisionStoreDbTest::testInsertRevisionOn_successes with data set "Detailed revision insertion" (array(MediaWiki\Storage\SlotRecord Object (...), true, true, CommentStoreComment Object (...), '20171117010101', true, true, 8))
row #1 mismatches
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     0 => '2'
     1 => '1'
-    2 => '2017-11-17 01:01:01 GMT'
+    2 => '2017-11-17 01:01:01+00'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:1809
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:444
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/McrWriteBothRevisionStoreDbTest.php:49
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:418
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
7) MediaWiki\Tests\Storage\McrWriteBothRevisionStoreDbTest::testGetSlotsQueryInfo with data set #1 (array('content'), array(array('revision'), array('slots.rev_id', 'NULL', 'slots.rev_id', ''main'', 'slots.rev_len', 'slots.rev_sha1', 'CONCAT('tt:',slots.rev_text_id)', 'slots.rev_content_model'), array()))
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
-    'content_address' => 'CONCAT('tt:',slots.rev_text_id)'
+    'content_address' => ''tt:' || slots.rev_text_id'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:1865
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:1722
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:1678
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
8) MediaWiki\Tests\Storage\NameTableStoreTest::testGetAndAcquireIdInsertCallback
Failed asserting that 175 is identical to 7251.
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/NameTableStoreTest.php:312
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
9) MediaWiki\Tests\Storage\NoContentModelRevisionStoreDbTest::testInsertRevisionOn_successes with data set "Bare minimum revision insertion" (array(MediaWiki\Storage\SlotRecord Object (...), true, CommentStoreComment Object (...), '20171117010101', true))
row #1 mismatches
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     0 => '2'
     1 => '1'
-    2 => '2017-11-17 01:01:01 GMT'
+    2 => '2017-11-17 01:01:01+00'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:1809
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:444
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:418
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
10) MediaWiki\Tests\Storage\NoContentModelRevisionStoreDbTest::testInsertRevisionOn_successes with data set "Detailed revision insertion" (array(MediaWiki\Storage\SlotRecord Object (...), true, true, CommentStoreComment Object (...), '20171117010101', true, true, 8))
row #1 mismatches
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     0 => '2'
     1 => '1'
-    2 => '2017-11-17 01:01:01 GMT'
+    2 => '2017-11-17 01:01:01+00'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:1809
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:444
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:418
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
11) MediaWiki\Tests\Storage\NoContentModelRevisionStoreDbTest::testGetSlotsQueryInfo with data set #1 (array('content'), array(array('revision'), array('slots.rev_id', 'NULL', 'slots.rev_id', ''main'', 'slots.rev_len', 'slots.rev_sha1', 'CONCAT('tt:',slots.rev_text_id)', 'NULL'), array()))
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'slot_revision_id' => 'slots.rev_id'
     'slot_origin' => 'slots.rev_id'
     'content_size' => 'slots.rev_len'
     'content_sha1' => 'slots.rev_sha1'
-    'content_address' => 'CONCAT('tt:',slots.rev_text_id)'
+    'content_address' => ''tt:' || slots.rev_text_id'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:1865
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:1722
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:1678
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
12) MediaWiki\Tests\Storage\PreMcrRevisionStoreDbTest::testInsertRevisionOn_successes with data set "Bare minimum revision insertion" (array(MediaWiki\Storage\SlotRecord Object (...), true, CommentStoreComment Object (...), '20171117010101', true))
row #1 mismatches
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     0 => '2'
     1 => '1'
-    2 => '2017-11-17 01:01:01 GMT'
+    2 => '2017-11-17 01:01:01+00'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:1809
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:444
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:418
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
13) MediaWiki\Tests\Storage\PreMcrRevisionStoreDbTest::testInsertRevisionOn_successes with data set "Detailed revision insertion" (array(MediaWiki\Storage\SlotRecord Object (...), true, true, CommentStoreComment Object (...), '20171117010101', true, true, 8))
row #1 mismatches
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     0 => '2'
     1 => '1'
-    2 => '2017-11-17 01:01:01 GMT'
+    2 => '2017-11-17 01:01:01+00'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:1809
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:444
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:418
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
14) MediaWiki\Tests\Storage\PreMcrRevisionStoreDbTest::testGetSlotsQueryInfo with data set #1 (array('content'), array(array('revision'), array('slots.rev_id', 'NULL', 'slots.rev_id', ''main'', 'slots.rev_len', 'slots.rev_sha1', 'CONCAT('tt:',slots.rev_text_id)', 'slots.rev_content_model'), array()))
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
-    'content_address' => 'CONCAT('tt:',slots.rev_text_id)'
+    'content_address' => ''tt:' || slots.rev_text_id'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:1865
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:1722
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/RevisionStoreDbTestBase.php:1678
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
15) MediaWiki\Tests\Storage\SqlBlobStoreTest::testSimpleStoreGetBlobSimpleRoundtripWindowsLegacyEncodingGzip with data set #2 ('sammansättningar')
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'sammansättningar'
+'sgϖ/j_oooTningoR'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/Storage/SqlBlobStoreTest.php:249
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
16) ApiBaseTest::testGetTitleOrPageIdInvalidPageId
Failed asserting that exception of type "Wikimedia\Rdbms\DBQueryError" matches expected exception "ApiUsageException". Message was: "A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: SELECT  page_id,page_namespace,page_title,page_restrictions,page_is_redirect,page_is_new,page_random,page_touched,page_links_updated,page_latest,page_len,page_content_model  FROM "unittest_page"    WHERE page_id = '2147483648'  LIMIT 1  
Function: WikiPage::newFromID
Error: 22003 ERROR:  value "2147483648" is out of range for type integer
LINE 1: ...nt_model  FROM "unittest_page"    WHERE page_id = '214748364...
                                                             ^
" at
/home/travis/build/wikimedia/mediawiki/includes/libs/rdbms/database/Database.php:1443
/home/travis/build/wikimedia/mediawiki/includes/libs/rdbms/database/Database.php:1413
/home/travis/build/wikimedia/mediawiki/includes/libs/rdbms/database/Database.php:1186
/home/travis/build/wikimedia/mediawiki/includes/libs/rdbms/database/Database.php:1640
/home/travis/build/wikimedia/mediawiki/includes/libs/rdbms/database/Database.php:1731
/home/travis/build/wikimedia/mediawiki/includes/page/WikiPage.php:174
/home/travis/build/wikimedia/mediawiki/includes/api/ApiBase.php:1062
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/api/ApiBaseTest.php:181
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
.
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
17) ChangeTagsTest::testUpdateTagsMigrationWriteBoth
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     0 => stdClass Object (
-        'ctd_name' => 'tag1'
-        'ctd_id' => 1
-        'ctd_count' => 2
+        'ctd_name' => 'tag2'
+        'ctd_id' => '2'
+        'ctd_count' => '1'
     )
     1 => stdClass Object (
-        'ctd_name' => 'tag2'
-        'ctd_id' => 2
-        'ctd_count' => 1
+        'ctd_name' => 'tag1'
+        'ctd_id' => '1'
+        'ctd_count' => '2'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/changetags/ChangeTagsTest.php:450
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
18) WikiPageMcrDbTest::testDoRollback
rollback did not revert to the correct revision
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'t8tivusls0jl6wusjjv1gfnakp75mwb'
+'to7r84xq6nktrsiigtf00jn7lggol52'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/page/WikiPageDbTestBase.php:1085
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
19) WikiPageMcrDbTest::testUpdateRedirectOn with data set #1 ('#REDIRECT [[Foo]]', true, 'Foo', true, false, 1)
row #1 mismatches
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => '1'
+    0 => '2'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:1809
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/page/WikiPageDbTestBase.php:1606
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/page/WikiPageDbTestBase.php:1598
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
20) WikiPageMcrWriteBothDbTest::testDoRollback
rollback did not revert to the correct revision
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'t8tivusls0jl6wusjjv1gfnakp75mwb'
+'to7r84xq6nktrsiigtf00jn7lggol52'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/page/WikiPageDbTestBase.php:1085
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
21) WikiPageMcrWriteBothDbTest::testUpdateRedirectOn with data set #1 ('#REDIRECT [[Foo]]', true, 'Foo', true, false, 1)
row #1 mismatches
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => '1'
+    0 => '2'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:1809
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/page/WikiPageDbTestBase.php:1606
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/page/WikiPageDbTestBase.php:1598
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
22) WikiPageNoContentModelDbTest::testDoRollback
rollback did not revert to the correct revision
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'t8tivusls0jl6wusjjv1gfnakp75mwb'
+'to7r84xq6nktrsiigtf00jn7lggol52'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/page/WikiPageDbTestBase.php:1085
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
23) WikiPageNoContentModelDbTest::testUpdateRedirectOn with data set #1 ('#REDIRECT [[Foo]]', true, 'Foo', true, false, 1)
row #1 mismatches
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => '1'
+    0 => '2'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:1809
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/page/WikiPageDbTestBase.php:1606
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/page/WikiPageDbTestBase.php:1598
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
24) WikiPagePreMcrDbTest::testDoRollback
rollback did not revert to the correct revision
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'t8tivusls0jl6wusjjv1gfnakp75mwb'
+'to7r84xq6nktrsiigtf00jn7lggol52'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/page/WikiPageDbTestBase.php:1085
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
25) WikiPagePreMcrDbTest::testUpdateRedirectOn with data set #1 ('#REDIRECT [[Foo]]', true, 'Foo', true, false, 1)
row #1 mismatches
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => '1'
+    0 => '2'
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:1809
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/page/WikiPageDbTestBase.php:1606
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/page/WikiPageDbTestBase.php:1598
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94
26) UserTest::testFindUsersByGroup
Failed asserting that false is true.
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/user/UserTest.php:589
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:469
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94

A while back @Anomie gave me some hints on IRC about the issues (lightly edited):

[07:43:30] <anomie> All the timestamp failures are someone hardcoding a timestamp (assuming TS_MW) instead of using $db->timestamp().
[07:43:35] <anomie> gzinflate() is probably something to do with code writing binary data to a text field. MySQL uses all binary fields, so it isn't noticed there.
[07:45:36] <anomie> The PageArchive failures are probably due to code inserting multiple revisions with the same timestamp and assuming the DB will silently break ties by rev_id. Not even MySQL guarantees that behavior, but the specific queries there probably happen to work.
[07:46:10] <anomie> SqlBlobStoreTest is probably another binary-vs-text fail.
[07:46:53] <anomie> The WikiPage ones are probably either binary-vs-text or ordering like PageArchive, I can't tell which from looking.
[07:47:40] <anomie> No idea about the MediaWikiTestCaseSchema1Test failures. That whole idea is semi-broken anyway, we'd need to do T191231 first to make it sane.
[08:02:57] <anomie> Also the PG schema uses "text" in cases where it should probably be using "bytea", so that's not entirely the calling code's fault. In general MW probably needs to get stricter about that distinction somehow or other.

Event Timeline

Legoktm created this task.May 29 2018, 6:50 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 29 2018, 6:50 AM

Change 436088 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/core@master] Call Database::timestamp in some tests

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

2) PageArchiveTest::testGetTextFromRow is actually completely unrelated to 1) PageArchiveTest::testListRevisions. The latter (#1) is easily fixed by solidifying the ordering, but the former isn't.

DatabasePostgres (and also DatabaseMssql and DatabaseOracle) remap the "user" and/or "text" tables to "mwuser" and "pagecontent", so people writing SQL queries by hand don't have to remember to quote the reserved words "user" and "text". For DatabasePostgres in particular, rMW556c5cf464b9: Rename "user" and "text" when upgrading on PostgreSQL made DatabasePostgres::tableExists() not do this remapping, probably so PostgresUpdater can check if an old "user"/"text" table needs renaming to "mwuser"/"pagecontent". But that breaks when MediaWikiTestCase::resetDb() checks if the table exists before resetting it. Sigh.

The easier, hackier solution would be to have MediaWikiTestCase::resetDb() reset "mwuser" and "pagecontent" too when asked to reset "user" and "text". The better (IMO) solution would be to get rid of the stupid remapping.

Change 436088 merged by jenkins-bot:
[mediawiki/core@master] Call Database::timestamp in some tests

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

Change 436969 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/core@master] Skip MediaWikiTestCaseSchema1Test on Postgres

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

Change 436970 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/core@master] tests: Reset mwuser/pagecontent tables if necessary for postgres

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

Change 436970 merged by jenkins-bot:
[mediawiki/core@master] tests: Reset mwuser/pagecontent tables if necessary for postgres

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

Change 436969 merged by jenkins-bot:
[mediawiki/core@master] Skip MediaWikiTestCaseSchema1Test on Postgres

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

Krinkle updated the task description. (Show Details)Jun 27 2018, 3:58 PM
Vvjjkkii renamed this task from Fix failing MediaWiki core tests on Postgres database backend to 83baaaaaaa.Jul 1 2018, 1:07 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: gerritbot, Aklapper.
Krinkle renamed this task from 83baaaaaaa to Fix failing MediaWiki core tests on Postgres database backend.Jul 1 2018, 11:39 PM
Krinkle raised the priority of this task from High to Needs Triage.
Krinkle updated the task description. (Show Details)
Krinkle added a subscriber: Aklapper.

Change 449669 had a related patch set uploaded (by Krinkle; owner: Legoktm):
[mediawiki/core@master] Disable PHPUnit tests that fail under postgres

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

Change 449669 merged by jenkins-bot:
[mediawiki/core@master] Disable PHPUnit tests that fail under postgres

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

Change 459601 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/libs/Timestamp@master] Fix TS_POSTGRES to match PostgreSQL's actual output

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

Change 459601 merged by jenkins-bot:
[mediawiki/libs/Timestamp@master] Fix TS_POSTGRES to match PostgreSQL's actual output

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

Change 459618 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/vendor@master] Update wikimedia/timestamp to v2.1.1

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

Change 459619 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] Update wikimedia/timestamp to v2.1.1

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

Change 459618 merged by jenkins-bot:
[mediawiki/vendor@master] Update wikimedia/timestamp to v2.1.1

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

Change 459619 merged by jenkins-bot:
[mediawiki/core@master] Update wikimedia/timestamp to v2.1.1

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

Jdforrester-WMF closed this task as Resolved.Sep 10 2018, 9:28 PM
Jdforrester-WMF claimed this task.
Jdforrester-WMF removed a project: Patch-For-Review.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

Change 471718 had a related patch set uploaded (by D3r1ck01; owner: Alangi Derick):
[mediawiki/core@master] Update wikimedia/timestamp to v2.1.1

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

Change 471718 abandoned by D3r1ck01:
Enable tests for PostgreSQL fixed by new version of wikimedia/timestamp

Reason:
Dropping this for now!

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

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:08 PM

Change 553404 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] WikiPage: Fix indeterminate ordering in doRollback

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

Change 553404 merged by jenkins-bot:
[mediawiki/core@master] WikiPage: Fix indeterminate ordering in doRollback

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

Krinkle closed this task as Resolved.Thu, Nov 28, 3:49 AM
Krinkle claimed this task.
Krinkle changed the subtype of this task from "Production Error" to "Task".
Anomie reopened this task as Open.Mon, Dec 2, 4:05 PM
Anomie removed Krinkle as the assignee of this task.
Anomie added a subscriber: Krinkle.

Reopening, there are still several tests with "FIXME: fails under postgres".

Note that mediawiki-quibble-vendor-postgres-php72-docker is passing and enforced on every commit, so those are presumably disabled tests of which we have many outside Postgres as well. Fixing the disabled ones is a new goal post. Moving that seems fine, but perhaps we can list the ones currently known to be disabled for that reason so that there is a clear endpoint for this task (therefore not including new tests that may be disabled for similar reasons after today).

Anomie added a comment.Tue, Dec 3, 4:57 PM

rMWb4ea2d8c8131: Disable PHPUnit tests that fail under postgres used that "FIXME: fails under postgres" comment. Only two were added since, in rMWc77d8705ca68: Stop updating tag_summary table. So that comment seems likely to fit the bill.

Ideally people would CR-1 patches trying to add new skips of that type.