Page MenuHomePhabricator

MediaModeration PHPUnit runs fails after RawMessage code change with "Premature access to service container" or different message text
Closed, ResolvedPublic2 Estimated Story Points

Description

On patch set https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MediaModeration/+/1055573

https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php74-noselenium/29223/console

There were 21 errors:

1) MediaWiki\Extension\MediaModeration\Tests\Unit\Services\MediaModerationFileScannerTest::testScanSha1 with data set "One File object that cannot be scanned for SHA-1 which already has been matched" (true, 1, array(false), array(), false, false, null, false)
LogicException: Premature access to service container

/workspace/src/includes/MediaWikiServices.php:327
/workspace/src/includes/context/RequestContext.php:471
/workspace/src/includes/Message/Message.php:421
/workspace/src/includes/Message/Message.php:1048
/workspace/src/includes/Message/Message.php:1137
/workspace/src/includes/language/RawMessage.php:110
/workspace/src/includes/libs/StatusValue.php:223
/workspace/src/includes/libs/StatusValue.php:276
/workspace/src/includes/libs/StatusValue.php:290
/workspace/src/extensions/MediaModeration/src/Services/MediaModerationFileScanner.php:72
/workspace/src/extensions/MediaModeration/tests/phpunit/unit/Services/MediaModerationFileScannerTest.php:140
/workspace/src/tests/phpunit/MediaWikiUnitTestCase.php:136
phpvfscomposer:///workspace/src/vendor/phpunit/phpunit/phpunit:106
[...]
There were 6 failures:

1) MediaWiki\Extension\MediaModeration\Tests\Unit\PhotoDNA\MediaModerationPhotoDNAResponseHandlerTest::testHandleResponse with data set "bad status, 3002" (false, MediaWiki\Extension\MediaModeration\PhotoDNA\Response Object (...), false, '3002: Invalid or missing requ...ter(s)')
Status should have message 3002: Invalid or missing request parameter(s)
<Error, collected 1 message(s) on the way, object value set"MediaWiki\Extension\MediaModeration\PhotoDNA\Response" instance>
+----------+---------------------------+--------------------------------------+
| error    | rawmessage                | 3002: Invalid or missing request par |
|          |                           | ameter(s)                            |
+----------+---------------------------+--------------------------------------+

/workspace/src/tests/phpunit/MediaWikiTestCaseTrait.php:369
/workspace/src/tests/phpunit/MediaWikiTestCaseTrait.php:407
/workspace/src/extensions/MediaModeration/tests/phpunit/unit/PhotoDNA/MediaModerationPhotoDNAResponseHandlerTest.php:32
/workspace/src/tests/phpunit/MediaWikiUnitTestCase.php:136
phpvfscomposer:///workspace/src/vendor/phpunit/phpunit/phpunit:106

Could be an impact from https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1049658 / 159dad8abb06db5ba26bed561b3c8f586b50b67c

Event Timeline

Change #1058214 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/MediaModeration@master] Unblock CI

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

Change #1058221 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[integration/config@master] Add MediaModeration to the gated extensions list

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

Change #1058214 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@master] Unblock CI

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

Dreamy_Jazz closed this task as Resolved.EditedJul 30 2024, 6:06 PM
Dreamy_Jazz claimed this task.

CI is now unblocked -> marking as resolved.

Adding the extension to the gate doesn't need to prevent this task being resolved IMO.

Change #1058221 merged by jenkins-bot:

[integration/config@master] Add MediaModeration to the gated extensions list

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

Still seeing failures on backport patches: 1058495: TranslatablePage: Store source page ids as string in WAN cache | https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Translate/+/1058495 -- should the fix be back-ported?

I would say that this should be backported.

Change #1058566 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/MediaModeration@wmf/1.43.0-wmf.16] Unblock CI

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

Change #1058567 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/MediaModeration@wmf/1.43.0-wmf.15] Unblock CI

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

Change #1058566 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@wmf/1.43.0-wmf.16] Unblock CI

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

Change #1058567 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@wmf/1.43.0-wmf.15] Unblock CI

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

Mentioned in SAL (#wikimedia-operations) [2024-07-31T10:39:01Z] <dreamyjazz@deploy1003> Started scap sync-world: Backport for [[gerrit:1058566|Unblock CI (T371324)]], [[gerrit:1058567|Unblock CI (T371324)]]

Mentioned in SAL (#wikimedia-operations) [2024-07-31T10:41:24Z] <dreamyjazz@deploy1003> dreamyjazz: Backport for [[gerrit:1058566|Unblock CI (T371324)]], [[gerrit:1058567|Unblock CI (T371324)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-07-31T10:46:30Z] <dreamyjazz@deploy1003> Finished scap: Backport for [[gerrit:1058566|Unblock CI (T371324)]], [[gerrit:1058567|Unblock CI (T371324)]] (duration: 07m 29s)