Page MenuHomePhabricator

Code merge blocker: MediaWiki\Auth\AuthManagerTest::testSecuritySensitiveOperationStatus with data set #0 (true)
Closed, ResolvedPublic


00:07:44.985 1) MediaWiki\Auth\AuthManagerTest::testSecuritySensitiveOperationStatus with data set #0 (true)
00:07:44.985 Expectation failed for method name is "onSecuritySensitiveOperationStatus" when invoked 2 time(s)
00:07:44.991 Parameter 3 for invocation MediaWiki\Auth\Hook\SecuritySensitiveOperationStatusHook::onSecuritySensitiveOperationStatus('ok', 'test2', MediaWiki\Session\Session Object (...), 501) does not match expected value.
00:07:44.991 Failed asserting that 501 matches expected 500.
00:07:44.991 /workspace/src/includes/HookContainer/HookContainer.php:160
00:07:44.991 /workspace/src/includes/HookContainer/HookRunner.php:3411
00:07:44.991 /workspace/src/includes/auth/AuthManager.php:870
00:07:44.991 /workspace/src/tests/phpunit/includes/auth/AuthManagerTest.php:522
00:07:44.991 /workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:530
00:07:44.991 phpvfscomposer:///workspace/src/vendor/phpunit/phpunit/phpunit:97
00:07:44.992 === Logs generated by test case
00:07:44.992 [objectcache] [debug] MainWANObjectCache using store {class} {"class":"HashBagOStuff"}
00:07:44.992 [localisation] [debug] LocalisationCache using store LCStoreNull []
00:07:44.992 [objectcache] [debug] MainObjectStash using store {class} {"class":"HashBagOStuff"}

Event Timeline

Jdforrester-WMF triaged this task as Unbreak Now! priority.Jul 26 2023, 2:41 PM
Jdforrester-WMF created this task.

The fourth parameter is named $timeSinceAuth, so this could happens when the next seconds starts while test is running. Could need a fake timer somewhere to get it fixed.

I'm working on this. There is

$mutableSession ? $this->equalTo( 500, 1 ) : $this->equalTo( -1 )

The second parameter to equalTo() is $delta, but it is apparently not respected, hence 501 is a failure.

It was $delta up until PHPUnit 9 (phpunit#3342), now there is no such parameter.

Change 942034 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] Fix flaky test testSecuritySensitiveOperationStatus

Change 942034 merged by jenkins-bot:

[mediawiki/core@master] Fix flaky test testSecuritySensitiveOperationStatus

tstarling claimed this task.