Page MenuHomePhabricator

Flow\Tests\Import\TalkpageImportOperationTest::testImportDoesntCompletelyFail fails on PHP 7.2
Closed, ResolvedPublic

Description

1) Flow\Tests\Import\TalkpageImportOperationTest::testImportDoesntCompletelyFail
Failed asserting that 0 matches expected 1.

/var/www/wiki/mediawiki/extensions/Flow/tests/phpunit/Import/TalkpageImportOperationTest.php:171
/var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:416
/var/www/wiki/mediawiki/core/maintenance/doMaintenance.php:94

https://integration.wikimedia.org/ci/job/wmf-quibble-core-vendor-mysql-php72-docker/4/console

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Are you seeing this locally or in CI?

Legoktm renamed this task from Flow\Tests\Import\TalkpageImportOperationTest::testImportDoesntCompletelyFail fails to Flow\Tests\Import\TalkpageImportOperationTest::testImportDoesntCompletelyFail fails on PHP 7.2.Oct 13 2018, 5:03 PM
Legoktm added a project: PHP 7.2 support.
Legoktm updated the task description. (Show Details)
Legoktm subscribed.

Are you seeing this locally or in CI?

I can also reproduce this failure on PHP 7.2 in CI. I'm guessing that's what Reedy also has locally.

Change 470469 had a related patch set uploaded (by Kosta Harlan; owner: Kosta Harlan):
[mediawiki/extensions/Flow@master] Check if result is an array before calling count()

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

It would be nice to use PHP 7.3's is_countable() instead of is_array() but I assume we can't do that because we want to support 7.0/7.1/7.2 as well?

It would be nice to use PHP 7.3's is_countable() instead of is_array() but I assume we can't do that because we want to support 7.0/7.1/7.2 as well?

We have historically polyfilled PHP functions (e.g. b9e1d5f5c066a26f115eac69e268a98e6591d121) in GlobalFunctions.php if we had a good case to use them. I'm not sure is_countable rises to that need since is_array is close enough for most cases.

Change 470469 merged by jenkins-bot:
[mediawiki/extensions/Flow@master] Check if result is an array before calling count()

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