Last modified: 2013-03-01 18:50:44 UTC
It beats me why but jenkins does not report any issues but when phpunit is run locally it shows: PHPUnit 3.7.13 MediaWiki 1.21alpha (3dd2209) PHP 5.4.7 (apache2handler) MySQL 5.5.27 Semantic MediaWiki (Version 1.9 alpha) (123fcdf) There were 2 errors: 1) SMW\Test\SQLStore\PropertyStatisticsTableTest::testInsertUsageCount with data set #42 (9001, 2147483648) MWException: The value to add must be a positive integer C:\xampp\htdocs\mw\extensions\SemanticMediaWiki\includes\storage\SQLStore\PropertyStatisticsTable.php:164 C:\xampp\htdocs\mw\extensions\SemanticMediaWiki\tests\phpunit\includes\storage\sqlstore\PropertyStatisticsTableTest.php:97 C:\xampp\htdocs\mw\tests\phpunit\MediaWikiTestCase.php:116 C:\xampp\htdocs\mw\tests\phpunit\MediaWikiPHPUnitCommand.php:63 C:\xampp\htdocs\mw\tests\phpunit\MediaWikiPHPUnitCommand.php:47 2) SMW\Test\SQLStore\PropertyStatisticsTableTest::testAddToUsageCounts MWException: The value to add must be a positive integer C:\xampp\htdocs\mw\extensions\SemanticMediaWiki\includes\storage\SQLStore\PropertyStatisticsTable.php:164 C:\xampp\htdocs\mw\extensions\SemanticMediaWiki\tests\phpunit\includes\storage\sqlstore\PropertyStatisticsTableTest.php:131 C:\xampp\htdocs\mw\tests\phpunit\MediaWikiTestCase.php:116 C:\xampp\htdocs\mw\tests\phpunit\MediaWikiPHPUnitCommand.php:63 C:\xampp\htdocs\mw\tests\phpunit\MediaWikiPHPUnitCommand.php:47
Not getting this error either locally.
Not sure why you are running into this, code looks correct. The exception certainly is. ... Can you verify that everything returned by usageCountProvider is a positive int? If you are running this on Windows, perhaps there is a to big int that overflows and thus ends up being negative (the default limit on Windows is smaller the the one on Linux, and we actually ran into this in the Wikidata project already).
Suspect line $usageCounts[] = array( 9001, pow( 2 , 31 ) ); Thought that would still be in range - perhaps not?
I'm going to facepalm if this is limit+1 :D
You are right, it has something to do with the limit (2147483647) tested because when changing pow( 2 , 31 ) to pow( 2 , 30 ) it passes the tests on windows.
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAGGGGGHHHHH! It is an off by one error >_> pow(2,31)>2147483647 => true pow(2,31)-1>2147483647 => false I feel trolled :)
https://gerrit.wikimedia.org/r/#/c/51673/