Page MenuHomePhabricator

Fix WikibaseDataModel CI for php 7.4
Closed, ResolvedPublic

Description

The travis CI build for php 7.4 breaks due to phpunit failures.

Apparently, all of the failing checks have to do with serialization / de-serialization:

  1. Wikibase\DataModel\Tests\ReferenceListTest::testGetValueHashIsTheSameForClone
  2. Wikibase\DataModel\Tests\ReferenceListTest::testSerializationStability
  3. Wikibase\DataModel\Tests\ReferenceListTest::testSerializeUnserializeRoundtrip
  4. Wikibase\DataModel\Tests\ReferenceListTest::testUnserializeCreatesNonIdenticalClones
  5. Wikibase\DataModel\Tests\Statement\StatementTest::testSerialize

In particular, assumptions such as:

	$clone = unserialize( serialize( $original ) );

	$this->assertTrue( $original->equals( $clone ) );
	$this->assertSame( $original->getValueHash(), $clone->getValueHash() );

do not seem to be valid any longer, in PHP 7.4

Possible cause: https://github.com/php/php-src/blob/ea1b8788773fe9d5fd517704da332f0725714b8b/UPGRADING#L148 (?)
Possible solution: https://github.com/php/php-src/blob/ea1b8788773fe9d5fd517704da332f0725714b8b/UPGRADING#L332 (?)

Example failures: https://travis-ci.org/wmde/WikibaseDataModel/jobs/641447598

Event Timeline

Restricted Application added a project: Wikidata. · View Herald TranscriptJan 24 2020, 11:40 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Addshore triaged this task as Low priority.Jan 24 2020, 11:41 AM
Addshore moved this task from Incoming to Ready to pick up on the Wikidata-Campsite board.
Addshore moved this task from Backlog to Other on the PHP 7.4 support board.
Reedy added a subscriber: Reedy.Jan 24 2020, 12:04 PM

Lots of spam from php_codesniffer too, I guess T243296: Release a new version of WikibaseCodeSniffer has some baring on that

Addshore moved this task from incoming to ready to go on the Wikidata board.Jan 24 2020, 3:24 PM

Lots of spam from php_codesniffer too, I guess T243296: Release a new version of WikibaseCodeSniffer has some baring on that

Yup!

@Addshore Hi! As you've listed this task as a good first task, more details in the task description are welcome. Maybe add where and how one can reproduce this error, link to the codebase, some hints/ideas for fixing the issue, etc. It might be easier that way for a newcomer to get started :)

If you think this task may not be too easy for a newcomer, consider removing the good first task tag! And, same goes for T243588

Addshore lowered the priority of this task from Low to Lowest.Jan 27 2020, 10:32 AM
Silvan_WMDE updated the task description. (Show Details)Jan 27 2020, 2:43 PM
Silvan_WMDE updated the task description. (Show Details)Jan 27 2020, 2:47 PM
Silvan_WMDE updated the task description. (Show Details)
Silvan_WMDE removed Silvan_WMDE as the assignee of this task.Jan 29 2020, 11:34 AM
Silvan_WMDE added a subscriber: Silvan_WMDE.
Silvan_WMDE removed a subscriber: Silvan_WMDE.

Is this the same set of issues that emit errors in the CI run?

00:18:23.529 There were 3 errors:
00:18:23.529 
00:18:23.529 1) Wikibase\Client\Tests\Api\ApiPropsEntityUsageTest::testEntityUsage with data set "by title" (array('query', 'entityusage', 'Vienna11|Berlin22'), array(array(array(array(array('O', 'S')))), array(array(array(array('S')), array(array('S'))))))
00:18:23.529 === Logs generated by test case
00:18:23.529 [localisation] [debug] LocalisationCache using store LCStoreNull []
00:18:23.529 [localisation] [debug] LocalisationCache using store LCStoreNull []
00:18:23.529 [MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
00:18:23.529 [objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
00:18:23.529 ===
00:18:23.529 Trying to access array offset on value of type null
00:18:23.529 
00:18:23.529 /workspace/src/includes/api/ApiPageSet.php:127
00:18:23.529 /workspace/src/extensions/Wikibase/client/tests/phpunit/includes/Api/ApiPropsEntityUsageTest.php:117
00:18:23.529 /workspace/src/extensions/Wikibase/client/tests/phpunit/includes/Api/ApiPropsEntityUsageTest.php:164
00:18:23.529 /workspace/src/extensions/Wikibase/client/tests/phpunit/includes/Api/ApiPropsEntityUsageTest.php:226
00:18:23.529 /workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:416
00:18:23.529 /workspace/src/maintenance/doMaintenance.php:99
00:18:23.529 
00:18:23.529 2) Wikibase\Client\Tests\Api\ApiPropsEntityUsageTest::testEntityUsage with data set "by entity" (array('query', 'entityusage', 'Vienna11|Berlin22', 'Q3|Q4'), array(array(array(array(array('O', 'S')))), array(array(array(array('S')), array(array('S'))))))
00:18:23.529 === Logs generated by test case
00:18:23.529 [objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
00:18:23.529 [localisation] [debug] LocalisationCache using store LCStoreNull []
00:18:23.529 [localisation] [debug] LocalisationCache using store LCStoreNull []
00:18:23.529 [MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
00:18:23.529 [objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
00:18:23.529 ===
00:18:23.529 Trying to access array offset on value of type null
00:18:23.529 
00:18:23.529 /workspace/src/includes/api/ApiPageSet.php:127
00:18:23.529 /workspace/src/extensions/Wikibase/client/tests/phpunit/includes/Api/ApiPropsEntityUsageTest.php:117
00:18:23.529 /workspace/src/extensions/Wikibase/client/tests/phpunit/includes/Api/ApiPropsEntityUsageTest.php:164
00:18:23.529 /workspace/src/extensions/Wikibase/client/tests/phpunit/includes/Api/ApiPropsEntityUsageTest.php:226
00:18:23.529 /workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:416
00:18:23.529 /workspace/src/maintenance/doMaintenance.php:99
00:18:23.529 
00:18:23.529 3) Wikibase\Client\Tests\Changes\ChangeRunCoalescerTest::testCoalesceChanges with data set "local link breaks" (array(Wikibase\Lib\Changes\ItemChange Object (...), Wikibase\Lib\Changes\ItemChange Object (...)), array(Wikibase\Lib\Changes\ItemChange Object (...), Wikibase\Lib\Changes\ItemChange Object (...)))
00:18:23.529 === Logs generated by test case
00:18:23.529 [objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
00:18:23.529 ===
00:18:23.529 Wikibase\Client\Changes\ChangeRunCoalescer::coalesceRuns:array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead [Called from Wikibase\Client\Changes\ChangeRunCoalescer::coalesceRuns in /workspace/src/extensions/Wikibase/client/includes/Changes/ChangeRunCoalescer.php at line 287]
00:18:23.529 
00:18:23.529 /workspace/src/includes/debug/MWDebug.php:333
00:18:23.529 /workspace/src/includes/debug/MWDebug.php:188
00:18:23.529 /workspace/src/includes/GlobalFunctions.php:1068
00:18:23.529 /workspace/src/extensions/Wikibase/client/includes/Changes/ChangeRunCoalescer.php:287
00:18:23.529 /workspace/src/extensions/Wikibase/client/includes/Changes/ChangeRunCoalescer.php:80
00:18:23.529 /workspace/src/extensions/Wikibase/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php:386
00:18:23.529 /workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:416
00:18:23.529 /workspace/src/maintenance/doMaintenance.php:99

Is this the same set of issues that emit errors in the CI run?

Apparently, no. Filed T247595 for that.

Reedy added a comment.Apr 24 2020, 3:57 PM

PHP 7.4 is stable, and now in a version of Ubuntu (20.04) that is likely to pick up usage...

Does this make it worth bumping up the priority a bit?

Reedy updated the task description. (Show Details)Apr 24 2020, 3:59 PM
Addshore raised the priority of this task from Lowest to Medium.May 20 2020, 6:51 PM
toan claimed this task.May 25 2020, 9:29 AM
Addshore closed this task as Resolved.May 26 2020, 2:33 PM

Will make the followup described in the PR now