Page MenuHomePhabricator

Failing tests for CheckUser when event table migration config set to WRITE_BOTH and READ_NEW
Closed, ResolvedPublic

Description

When running tests for the CheckUser extension with the event table migration config set to WRITE_BOTH and READ_NEW (or just NEW), the following tests fail which pass when the migration config is set to the default value (of READ_OLD and WRITE_OLD):

There were 9 failures:

1) MediaWiki\CheckUser\Tests\Integration\CheckUser\Pagers\AbstractCheckUserPagerTest::testGetPeriodCondition with data set "Period value for 7 days" (7, '1653077137', '20220513000000')
A different time condition was generated than expected.
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => 'cuc_timestamp >= '20220513000000''
+    0 => 'timestamp >= '20220513000000''
 )

/var/www/html/w/tests/phpunit/MediaWikiTestCaseTrait.php:275
/var/www/html/w/extensions/CheckUser/tests/phpunit/integration/CheckUser/Pagers/AbstractCheckUserPagerTest.php:194
/var/www/html/w/tests/phpunit/MediaWikiIntegrationTestCase.php:518

2) MediaWiki\CheckUser\Tests\Integration\CheckUser\Pagers\AbstractCheckUserPagerTest::testGetPeriodCondition with data set "Period value for 30 days" (30, '1653047635', '20220420000000')
A different time condition was generated than expected.
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => 'cuc_timestamp >= '20220420000000''
+    0 => 'timestamp >= '20220420000000''
 )

/var/www/html/w/tests/phpunit/MediaWikiTestCaseTrait.php:275
/var/www/html/w/extensions/CheckUser/tests/phpunit/integration/CheckUser/Pagers/AbstractCheckUserPagerTest.php:194
/var/www/html/w/tests/phpunit/MediaWikiIntegrationTestCase.php:518

3) MediaWiki\CheckUser\Tests\Integration\CheckUserUnionSelectQueryBuilderDatabaseTest::testFetchResultSet with data set "4 entries in each table with default LIMIT" (array(1689449370, 1689449272, 1689449320, 1689449362), array(1689449369, 1689449271, 1689449322, 1689449361), array(1689449368, 1689449270, 1689449321, 1689449360), true, true, 5000)
The fetched result was not returned correctly.
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => 1689449370
-    1 => 1689449369
-    2 => 1689449368
-    3 => 1689449362
-    4 => 1689449361
-    5 => 1689449360
-    6 => 1689449322
-    7 => 1689449321
-    8 => 1689449320
-    9 => 1689449272
-    10 => 1689449271
-    11 => 1689449270
+    0 => '1689449378'
+    1 => '1689449378'
+    2 => '1689449376'
+    3 => '1689449370'
+    4 => '1689449369'
+    5 => '1689449368'
+    6 => '1689449362'
+    7 => '1689449361'
+    8 => '1689449360'
+    9 => '1689449322'
+    10 => '1689449321'
+    11 => '1689449320'
+    12 => '1689449272'
+    13 => '1689449271'
+    14 => '1689449270'
 )

/var/www/html/w/tests/phpunit/MediaWikiTestCaseTrait.php:275
/var/www/html/w/extensions/CheckUser/tests/phpunit/integration/CheckUserUnionSelectQueryBuilderDatabaseTest.php:163
/var/www/html/w/tests/phpunit/MediaWikiIntegrationTestCase.php:518

4) MediaWiki\CheckUser\Tests\Integration\HooksTest::testOnAuthManagerLoginAuthenticateAudit with data set "successful login" (MediaWiki\Auth\AuthenticationResponse Object (...), 'UTSysop', 'checkuser-login-success', false)
row #1 missing
Failed asserting that false is not false.

/var/www/html/w/tests/phpunit/MediaWikiIntegrationTestCase.php:2288
/var/www/html/w/extensions/CheckUser/tests/phpunit/integration/HooksTest.php:948
/var/www/html/w/tests/phpunit/MediaWikiIntegrationTestCase.php:518

5) MediaWiki\CheckUser\Tests\Integration\HooksTest::testOnAuthManagerLoginAuthenticateAudit with data set "failed login" (MediaWiki\Auth\AuthenticationResponse Object (...), 'UTSysop', 'checkuser-login-failure', true)
row #1 missing
Failed asserting that false is not false.

/var/www/html/w/tests/phpunit/MediaWikiIntegrationTestCase.php:2288
/var/www/html/w/extensions/CheckUser/tests/phpunit/integration/HooksTest.php:948
/var/www/html/w/tests/phpunit/MediaWikiIntegrationTestCase.php:518

6) MediaWiki\CheckUser\Tests\Integration\HooksTest::testOnAuthManagerLoginAuthenticateAuditWithCentralAuthInstalled with data set "failed login with correct password" (MediaWiki\Auth\AuthenticationResponse Object (...), 'UTSysop', 'checkuser-login-failure-with-...ssword', true)
row #1 missing
Failed asserting that false is not false.

/var/www/html/w/tests/phpunit/MediaWikiIntegrationTestCase.php:2288
/var/www/html/w/extensions/CheckUser/tests/phpunit/integration/HooksTest.php:948
/var/www/html/w/extensions/CheckUser/tests/phpunit/integration/HooksTest.php:978
/var/www/html/w/tests/phpunit/MediaWikiIntegrationTestCase.php:518

7) MediaWiki\CheckUser\Tests\Integration\HooksTest::testOnAuthManagerLoginAuthenticateAuditWithCentralAuthInstalled with data set "failed login with the correct password but locked and no local account" (MediaWiki\Auth\AuthenticationResponse Object (...), 'Nonexisting test account 1234567', 'checkuser-login-failure-with-...ssword', true)
row #1 missing
Failed asserting that false is not false.

/var/www/html/w/tests/phpunit/MediaWikiIntegrationTestCase.php:2288
/var/www/html/w/extensions/CheckUser/tests/phpunit/integration/HooksTest.php:948
/var/www/html/w/extensions/CheckUser/tests/phpunit/integration/HooksTest.php:978
/var/www/html/w/tests/phpunit/MediaWikiIntegrationTestCase.php:518

8) MediaWiki\CheckUser\Tests\Integration\HooksTest::testOnAuthManagerLoginAuthenticateAuditWithCentralAuthInstalled with data set "failed login with correct password but locked" (MediaWiki\Auth\AuthenticationResponse Object (...), 'UTSysop', 'checkuser-login-failure-with-...ssword', false)
row #1 missing
Failed asserting that false is not false.

/var/www/html/w/tests/phpunit/MediaWikiIntegrationTestCase.php:2288
/var/www/html/w/extensions/CheckUser/tests/phpunit/integration/HooksTest.php:948
/var/www/html/w/extensions/CheckUser/tests/phpunit/integration/HooksTest.php:978
/var/www/html/w/tests/phpunit/MediaWikiIntegrationTestCase.php:518

9) MediaWiki\CheckUser\Tests\Integration\HooksTest::testCheckUserLogBotSuccessfulLoginsSetToTrue
row #1 missing
Failed asserting that false is not false.

/var/www/html/w/tests/phpunit/MediaWikiIntegrationTestCase.php:2288
/var/www/html/w/extensions/CheckUser/tests/phpunit/integration/HooksTest.php:948
/var/www/html/w/extensions/CheckUser/tests/phpunit/integration/HooksTest.php:1034
/var/www/html/w/tests/phpunit/MediaWikiIntegrationTestCase.php:51

These tests should be either:

  • Fixed to work with different event table migration stages
  • Pinned to use SCHEMA_COMPAT_OLD if the above is not relevant

Related Objects

StatusSubtypeAssignedTask
ResolvedSecurityZabe
ResolvedSecurityDreamy_Jazz
ResolvedSecurityDreamy_Jazz
ResolvedSecurityDreamy_Jazz
OpenBUG REPORTNone
OpenBUG REPORTNone
OpenBUG REPORTNone
OpenDreamy_Jazz
OpenNone
OpenNone
OpenNone
OpenFeatureDreamy_Jazz
DuplicateNone
OpenFeatureNone
OpenFeatureNone
OpenFeatureNone
ResolvedFeatureDreamy_Jazz
ResolvedFeatureDreamy_Jazz
ResolvedFeatureDreamy_Jazz
OpenFeatureNone
OpenFeatureNone
ResolvedBUG REPORTDreamy_Jazz
OpenFeatureNone
OpenFeatureNone
ResolvedGlaisher
OpenNone
OpenFeatureNone
ResolvedGlaisher
ResolvedNiharika
ResolvedNone
ResolvedFeatureDreamy_Jazz
DeclinedNone
ResolvedFeatureDreamy_Jazz
ResolvedFeatureDreamy_Jazz
DuplicateNone
OpenNone
DuplicateNone
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
OpenFeatureNone
ResolvedDreamy_Jazz
OpenBUG REPORTNone
ResolvedBUG REPORTDreamy_Jazz
OpenNone
OpenFeatureNone
DeclinedFeatureNone
OpenFeatureNone
OpenDreamy_Jazz
In Progresskostajh
OpenNone
OpenNone
OpenNone
OpenNone
OpenTchanders
OpenFeatureDreamy_Jazz
ResolvedDreamy_Jazz

Event Timeline

Change 886482 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Add support for writing both new and old to Hooks.php

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

Change 938407 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Fix AbstractCheckUserPagerTest for event table migration

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

Change 938006 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Make multiple fixes to CheckUserUnionSelectQueryBuilder

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

Change 886482 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Add support for writing both new and old to Hooks.php

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

Change 938407 abandoned by Dreamy Jazz:

[mediawiki/extensions/CheckUser@master] Fix AbstractCheckUserPagerTest for event table migration

Reason:

Per the reasoning by Urbanecm, this can wait until the pagers actually support reading new.

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

Change 938006 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Make multiple fixes to CheckUserUnionSelectQueryBuilder

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

Moved to QA/Testing. I would suggest that no QA/Testing is needed for this task as the scope of this task was to fix CI tests. The other changes in the linked tasks would be tested through other tickets.

dom_walden added a subscriber: dom_walden.

Moved to QA/Testing. I would suggest that no QA/Testing is needed for this task as the scope of this task was to fix CI tests. The other changes in the linked tasks would be tested through other tickets.

OK. Thanks for letting us know.

Change 941414 had a related patch set uploaded (by Urbanecm; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@wmf/1.41.0-wmf.18] Add support for writing both new and old to Hooks.php

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

Change 941414 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@wmf/1.41.0-wmf.18] Add support for writing both new and old to Hooks.php

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

Mentioned in SAL (#wikimedia-operations) [2023-07-25T13:30:52Z] <urbanecm@deploy1002> Started scap: Backport for [[gerrit:941414|Add support for writing both new and old to Hooks.php (T341934 T341586)]], [[gerrit:941400|Follow-up: Add support for writing both new and old to Hooks.php (T341586)]]

Mentioned in SAL (#wikimedia-operations) [2023-07-25T13:38:21Z] <urbanecm@deploy1002> Finished scap: Backport for [[gerrit:941414|Add support for writing both new and old to Hooks.php (T341934 T341586)]], [[gerrit:941400|Follow-up: Add support for writing both new and old to Hooks.php (T341586)]] (duration: 07m 28s)