Last modified: 2014-08-17 13:42:41 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T58909, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56909 - PHP unit tests don't work if not run from tests/phpunit directory - "Call to a member function numRows() on a non-object"
PHP unit tests don't work if not run from tests/phpunit directory - "Call to ...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Unit tests (Other open bugs)
1.23.0
All All
: Normal normal (vote)
: 1.23.x release
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-11 17:37 UTC by Sam Reed (reedy)
Modified: 2014-08-17 13:42 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---
umherirrender_de.wp: Backport_to_Stable+


Attachments

Description Sam Reed (reedy) 2013-11-11 17:37:53 UTC
reedy@ubuntu64-web-esxi:/var/www/wiki/mediawiki/core$ php tests/phpunit/phpunit.php
PHPUnit 3.7.28 by Sebastian Bergmann.

Configuration read from /var/www/wiki/mediawiki/core/tests/phpunit/suite.xml

...............................................EEEPHP Fatal error:  Call to a member function numRows() on a non-object in /var/www/wiki/mediawiki/core/includes/objectcache/SqlBagOStuff.php on line 512
PHP Stack trace:
PHP   1. {main}() /var/www/wiki/mediawiki/core/tests/phpunit/phpunit.php:0
PHP   2. MediaWikiPHPUnitCommand::main() /var/www/wiki/mediawiki/core/tests/phpunit/phpunit.php:119
PHP   3. MediaWikiPHPUnitCommand->run() /var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiPHPUnitCommand.php:64
PHP   4. PHPUnit_TextUI_Command->run() /var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiPHPUnitCommand.php:80
PHP   5. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:176
PHP   6. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/TextUI/TestRunner.php:349
PHP   7. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
PHP   8. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
PHP   9. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
PHP  10. PHPUnit_Framework_TestSuite->runTest() /usr/share/php/PHPUnit/Framework/TestSuite.php:745
PHP  11. MediaWikiTestCase->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:775
PHP  12. PHPUnit_Framework_TestCase->run() /var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:116
PHP  13. PHPUnit_Framework_TestResult->run() /usr/share/php/PHPUnit/Framework/TestCase.php:783
PHP  14. PHP_Invoker->invoke() /usr/share/php/PHPUnit/Framework/TestResult.php:646
PHP  15. call_user_func_array() /usr/share/php/PHP/Invoker.php:93
PHP  16. PHPUnit_Framework_TestCase->runBare() /usr/share/php/PHP/Invoker.php:93
PHP  17. PHPUnit_Framework_TestCase->runTest() /usr/share/php/PHPUnit/Framework/TestCase.php:838
PHP  18. ReflectionMethod->invokeArgs() /usr/share/php/PHPUnit/Framework/TestCase.php:983
PHP  19. CollationTest->testGetFirstLetter() /usr/share/php/PHPUnit/Framework/TestCase.php:983
PHP  20. IcuCollation->getFirstLetter() /var/www/wiki/mediawiki/core/tests/phpunit/includes/CollationTest.php:94
PHP  21. IcuCollation->getFirstLetterCount() /var/www/wiki/mediawiki/core/includes/Collation.php:333
PHP  22. IcuCollation->getFirstLetterData() /var/www/wiki/mediawiki/core/includes/Collation.php:497
PHP  23. SqlBagOStuff->get() /var/www/wiki/mediawiki/core/includes/Collation.php:351
PHP  24. SqlBagOStuff->getMulti() /var/www/wiki/mediawiki/core/includes/objectcache/SqlBagOStuff.php:200
PHP  25. SqlBagOStuff->garbageCollect() /var/www/wiki/mediawiki/core/includes/objectcache/SqlBagOStuff.php:221
PHP  26. SqlBagOStuff->expireAll() /var/www/wiki/mediawiki/core/includes/objectcache/SqlBagOStuff.php:478
PHP  27. SqlBagOStuff->deleteObjectsExpiringBefore() /var/www/wiki/mediawiki/core/includes/objectcache/SqlBagOStuff.php:483

Fatal error: Call to a member function numRows() on a non-object in /var/www/wiki/mediawiki/core/includes/objectcache/SqlBagOStuff.php on line 512

Call Stack:
    0.0009     245936   1. {main}() /var/www/wiki/mediawiki/core/tests/phpunit/phpunit.php:0
    2.1811   14020520   2. MediaWikiPHPUnitCommand::main() /var/www/wiki/mediawiki/core/tests/phpunit/phpunit.php:119
    2.1813   14032872   3. MediaWikiPHPUnitCommand->run() /var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiPHPUnitCommand.php:64
    2.1813   14033352   4. PHPUnit_TextUI_Command->run() /var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiPHPUnitCommand.php:80
    7.9824   86568944   5. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:176
    7.9973   86890608   6. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/TextUI/TestRunner.php:349
    8.1015   86892360   7. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
   17.3521  113192856   8. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
   17.3889  113253808   9. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
   20.9046  115305016  10. PHPUnit_Framework_TestSuite->runTest() /usr/share/php/PHPUnit/Framework/TestSuite.php:745
   20.9046  115305016  11. MediaWikiTestCase->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:775
   20.9046  115305168  12. PHPUnit_Framework_TestCase->run() /var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:116
   20.9047  115305168  13. PHPUnit_Framework_TestResult->run() /usr/share/php/PHPUnit/Framework/TestCase.php:783
   20.9049  115306896  14. PHP_Invoker->invoke() /usr/share/php/PHPUnit/Framework/TestResult.php:646
   20.9049  115306816  15. call_user_func_array() /usr/share/php/PHP/Invoker.php:93
   20.9049  115306984  16. PHPUnit_Framework_TestCase->runBare() /usr/share/php/PHP/Invoker.php:93
   20.9052  115324728  17. PHPUnit_Framework_TestCase->runTest() /usr/share/php/PHPUnit/Framework/TestCase.php:838
   20.9052  115325840  18. ReflectionMethod->invokeArgs() /usr/share/php/PHPUnit/Framework/TestCase.php:983
   20.9052  115325880  19. CollationTest->testGetFirstLetter() /usr/share/php/PHPUnit/Framework/TestCase.php:983
   20.9054  115326360  20. IcuCollation->getFirstLetter() /var/www/wiki/mediawiki/core/tests/phpunit/includes/CollationTest.php:94
   20.9056  115327080  21. IcuCollation->getFirstLetterCount() /var/www/wiki/mediawiki/core/includes/Collation.php:333
   20.9056  115327080  22. IcuCollation->getFirstLetterData() /var/www/wiki/mediawiki/core/includes/Collation.php:497
   20.9056  115327184  23. SqlBagOStuff->get() /var/www/wiki/mediawiki/core/includes/Collation.php:351
   20.9056  115327536  24. SqlBagOStuff->getMulti() /var/www/wiki/mediawiki/core/includes/objectcache/SqlBagOStuff.php:200
   20.9056  115328648  25. SqlBagOStuff->garbageCollect() /var/www/wiki/mediawiki/core/includes/objectcache/SqlBagOStuff.php:221
   20.9057  115328736  26. SqlBagOStuff->expireAll() /var/www/wiki/mediawiki/core/includes/objectcache/SqlBagOStuff.php:478
   20.9058  115329352  27. SqlBagOStuff->deleteObjectsExpiringBefore() /var/www/wiki/mediawiki/core/includes/objectcache/SqlBagOStuff.php:483
Comment 1 Antoine "hashar" Musso (WMF) 2013-12-18 10:27:11 UTC
This need to be bisected to find out which commit caused the issue. I am not sure which tests are failing exactly, could you rerun using --tap option i.e.:

 php tests/phpunit/phpunit.php --tap

Bisecting to find the root cause would be a huge plus :-D
Comment 2 Umherirrender 2014-01-31 18:51:34 UTC
See also bug 56661
Comment 3 Umherirrender 2014-07-19 08:09:27 UTC
Maybe fixed by Gerrit change #141619
Comment 4 Umherirrender 2014-07-25 14:53:30 UTC
(In reply to Umherirrender from comment #3)
> Maybe fixed by Gerrit change #141619

Now merged, should be fixed.
Comment 5 Antoine "hashar" Musso (WMF) 2014-07-25 21:55:01 UTC
Could use the patch on REL1_23 since we will surely have that issue when running tests.
Comment 6 Mark A. Hershberger 2014-07-26 16:32:22 UTC
This isn't trivial to cherry pick.  Was the problem in 1.23?
Comment 7 Mark A. Hershberger 2014-07-26 17:00:33 UTC
Sorry didn't mean to mark this "denied".
Comment 8 Umherirrender 2014-07-26 17:35:53 UTC
The merge conflict is with Gerrit change #146674, which was also the conflict on the first Code-Review+2. Add me as reviewer to the patch set, when the conflict should be resolved, or cherry-pick also that patch set.
Comment 9 Umherirrender 2014-08-17 13:29:12 UTC
Cherry-Picked to REL1_23: Gerrit change #154460
Comment 10 Umherirrender 2014-08-17 13:42:41 UTC
successfully backported to 1.23

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links