Page MenuHomePhabricator

LexemeSpecialWhatLinksHereTest fails when run with --use-normal-tables
Closed, ResolvedPublic

Description

Running the folllowing:

mw-docker-dev phpunit default --use-normal-tables //var/www/mediawiki/extensions/WikibaseLexeme/tests/phpunit/mediawiki

Generates the following:

[0f397461cab7df2132cbbb07] [no req]   Wikimedia\Rdbms\DBQueryError from line 1443 of /var/www/mediawiki/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?
Query: SELECT  ug_user,ug_group,ug_expiry  FROM `LexemeSpecialWhatLinksHereTest-table-user_groups`    WHERE ug_user = '1'
Function: UserGroupMembership::getMembershipsForUser
Error: 1146 Table 'default.LexemeSpecialWhatLinksHereTest-table-user_groups' doesn't exist (db-master)

Backtrace:
#0 /var/www/mediawiki/includes/libs/rdbms/database/Database.php(1413): Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string)
#1 /var/www/mediawiki/includes/libs/rdbms/database/Database.php(1186): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#2 /var/www/mediawiki/includes/libs/rdbms/database/Database.php(1640): Wikimedia\Rdbms\Database->query(string, string)
#3 /var/www/mediawiki/includes/user/UserGroupMembership.php(317): Wikimedia\Rdbms\Database->select(string, array, array, string)
#4 /var/www/mediawiki/includes/user/User.php(1612): UserGroupMembership::getMembershipsForUser(integer, Wikimedia\Rdbms\DatabaseMysqli)
#5 /var/www/mediawiki/includes/user/User.php(3566): User->loadGroups()
#6 /var/www/mediawiki/includes/user/User.php(3593): User->getGroups()
#7 /var/www/mediawiki/includes/user/User.php(3525): User->getEffectiveGroups()
#8 /var/www/mediawiki/includes/user/User.php(3836): User->getRights()
#9 /var/www/mediawiki/includes/Title.php(2266): User->isAllowed(string)
#10 /var/www/mediawiki/includes/Title.php(2824): Title->checkQuickPermissions(string, User, array, string, boolean)
#11 /var/www/mediawiki/includes/Title.php(2162): Title->getUserPermissionsErrorsInternal(string, User, string, boolean)
#12 /var/www/mediawiki/includes/page/WikiPage.php(1846): Title->userCan(string, User)
#13 /var/www/mediawiki/tests/phpunit/MediaWikiTestCase.php(1246): WikiPage->doEditContent(WikitextContent, CommentStoreComment, integer, boolean, User)
#14 /var/www/mediawiki/tests/phpunit/MediaWikiTestCase.php(1801): MediaWikiTestCase->addCoreDBData()
#15 /var/www/mediawiki/tests/phpunit/MediaWikiTestCase.php(478): MediaWikiTestCase->resetDB(Wikimedia\Rdbms\DatabaseMysqli, array)
#16 /var/www/mediawiki/vendor/phpunit/phpunit/src/Framework/TestSuite.php(755): MediaWikiTestCase->run(PHPUnit\Framework\TestResult)
#17 /var/www/mediawiki/vendor/phpunit/phpunit/src/Framework/TestSuite.php(755): PHPUnit\Framework\TestSuite->run(PHPUnit\Framework\TestResult)
#18 /var/www/mediawiki/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(546): PHPUnit\Framework\TestSuite->run(PHPUnit\Framework\TestResult)
#19 /var/www/mediawiki/vendor/phpunit/phpunit/src/TextUI/Command.php(195): PHPUnit\TextUI\TestRunner->doRun(PHPUnit\Framework\TestSuite, array, boolean)
#20 /var/www/mediawiki/vendor/phpunit/phpunit/src/TextUI/Command.php(148): PHPUnit\TextUI\Command->run(array, boolean)
#21 /var/www/mediawiki/tests/phpunit/phpunit.php(135): PHPUnit\TextUI\Command::main()
#22 /var/www/mediawiki/maintenance/doMaintenance.php(94): PHPUnitMaintClass->execute()
#23 /var/www/mediawiki/tests/phpunit/phpunit.php(174): require(string)
#24 {main}

This most likely relates to the use of the "NonTempTableTestCase"

Event Timeline

Change 450993 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/WikibaseLexeme@master] Only create non-temporary tables when needed.

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

Change 450993 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Only create non-temporary tables when needed.

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