Page MenuHomePhabricator

CheckUser test failing on SQLite
Closed, ResolvedPublic

Description

ComparePagerTest::testDoQuery is failing on SQLite, hence causing the build to fail for any extension that depends on CheckUser (e.g. AbuseFilter, where this was discovered). See https://integration.wikimedia.org/ci/job/quibble-vendor-sqlite-php72-noselenium-docker/43/console:

There were 6 errors:

1) ComparePagerTest::testDoQuery with data set "Valid and invalid targets" (array('User1', 'InvalidUser', '1.2.3.9/120'), array(), 2)
=== Logs generated by test case
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[wfDebug] [debug] IP: 127.0.0.1 {"private":false}
[wfDebug] [debug] IP: 127.0.0.1 {"private":false}
[GlobalTitleFail] [info] RequestContext::getTitle called with no title set. {"exception":{}}
[MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
[GlobalTitleFail] [info] RequestContext::getTitle called with no title set. {"exception":{}}
[GlobalTitleFail] [info] RequestContext::getTitle called with no title set. {"exception":{}}
[GlobalTitleFail] [info] RequestContext::getTitle called with no title set. {"exception":{}}
===
Undefined index: cuc_user_text

/workspace/src/includes/pager/IndexPager.php:368
/workspace/src/includes/pager/IndexPager.php:271
/workspace/src/extensions/CheckUser/src/ComparePager.php:246
/workspace/src/extensions/CheckUser/tests/phpunit/ComparePagerTest.php:53
/workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:437
/workspace/src/maintenance/doMaintenance.php:105

the other 5 errors are similar. Apparently the query is returning 0 rows, but aside from that, I can't really tell what's going on.

This *could* be related to T253199, if some wrong data type is being added to the DB (of note, the cu_changes.sql uses '0' as default for integer and bool fields).

Event Timeline

Change 598563 had a related patch set uploaded (by Daimona Eaytoy; owner: Dbarratt):
[mediawiki/extensions/CheckUser@master] Alias the column names for the result

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

Change 598714 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/CheckUser@master] Fix a test on SQLite

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

Change 598563 merged by jenkins-bot:
[mediawiki/extensions/CheckUser@master] Alias the column names for the result

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

Change 598714 merged by jenkins-bot:
[mediawiki/extensions/CheckUser@master] Fix a test on SQLite

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

Daimona claimed this task.