Page MenuHomePhabricator

Constant MT_RAND_PHP is deprecated in php8.3 (used in SamplingStatsdClientTest)
Closed, ResolvedPublic

Description

MT_RAND_PHP is used along with mt_srand to set a seed and make the values of mt_rand known for the tests, but it is deprecated in php8.3
Just using mt_srand without the parameter to use MT_RAND_MT19937 makes the test fail in php7.4 (and php8.1)

21) SamplingStatsdClientTest::testSampling with data set #0 (Liuggio\StatsdClient\Entity\StatsdData Object (...), 1, 0, true)
Constant MT_RAND_PHP is deprecated

/workspace/src/tests/phpunit/unit/includes/libs/SamplingStatsdClientTest.php:26

22) SamplingStatsdClientTest::testSampling with data set #1 (Liuggio\StatsdClient\Entity\StatsdData Object (...), 1, 0, false)
Constant MT_RAND_PHP is deprecated

/workspace/src/tests/phpunit/unit/includes/libs/SamplingStatsdClientTest.php:26

23) SamplingStatsdClientTest::testSampling with data set #2 (Liuggio\StatsdClient\Entity\StatsdData Object (...), 1, 4, true)
Constant MT_RAND_PHP is deprecated

/workspace/src/tests/phpunit/unit/includes/libs/SamplingStatsdClientTest.php:26

24) SamplingStatsdClientTest::testSampling with data set #3 (Liuggio\StatsdClient\Entity\StatsdData Object (...), 0.1, 0, false)
Constant MT_RAND_PHP is deprecated

/workspace/src/tests/phpunit/unit/includes/libs/SamplingStatsdClientTest.php:26

25) SamplingStatsdClientTest::testSampling with data set #4 (Liuggio\StatsdClient\Entity\StatsdData Object (...), 0.5, 0, false)
Constant MT_RAND_PHP is deprecated

/workspace/src/tests/phpunit/unit/includes/libs/SamplingStatsdClientTest.php:26

26) SamplingStatsdClientTest::testSampling with data set #5 (Liuggio\StatsdClient\Entity\StatsdData Object (...), 0.5, 4, false)
Constant MT_RAND_PHP is deprecated

Event Timeline

Change #1017486 had a related patch set uploaded (by TK-999; author: TK-999):

[mediawiki/core@master] SamplingStatsdClientTest: Stop using the legacy MT algorithm

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

Change #1017486 merged by jenkins-bot:

[mediawiki/core@master] SamplingStatsdClientTest: Stop using the legacy MT algorithm

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