Page MenuHomePhabricator

The return value of method Wikimedia\Rdbms\DBConnRef::getScopedLockAndFlush() should either be used or intentionally ignored by casting it as (void) (from tests/phpunit/includes/DB/LoadBalancerTest.php:630)
Closed, ResolvedPublic

Description

Cross-reference https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1180659 (Add #[\NoDiscard] to functions that return ScopedCallback; 83171021b16f)

  • mediawiki/core (84b44c1d7dbf) locally, running PHP 8.5
  • composer phpunit:entrypoint -- --filter LoadBalancerTest
1) LoadBalancerTest::testDBConnRefReadsMasterAndReplicaRoles
The return value of method Wikimedia\Rdbms\DBConnRef::getScopedLockAndFlush() should either be used or intentionally ignored by casting it as (void)

/[...]/mediawiki/core/tests/phpunit/includes/DB/LoadBalancerTest.php:630

(note: not yet seen in WMF experimental CI due to the order in which it runs MediaWiki's PHPUnit tests, but it presumably would be seen there at some point)

Event Timeline

Change #1226252 had a related patch set uploaded (by Bartosz Dziewoński; author: Shivaansh Singh):

[mediawiki/core@master] Fix PHP 8.5 warning for unused return value in LoadBalancerTest

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

Change #1226252 merged by jenkins-bot:

[mediawiki/core@master] Fix PHP 8.5 warning for unused return value in LoadBalancerTest

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

matmarex assigned this task to ShivaanshSingh.
matmarex subscribed.

Thanks for the patch @ShivaanshSingh!