Page MenuHomePhabricator

OpenStackManager test failures on PHP 8.0 via LdapAuthentication
Closed, ResolvedPublic

Description

22:54:27 1) SpecialPageFatalTest::testSpecialPageDoesNotFatal
22:54:27 TypeError: ldap_bind(): Argument #1 ($ldap) must be of type resource, null given
22:54:27 
22:54:27 /workspace/src/extensions/LdapAuthentication/includes/LdapAuthenticationPlugin.php:98
22:54:27 /workspace/src/extensions/LdapAuthentication/includes/LdapAuthenticationPlugin.php:2043
22:54:27 /workspace/src/extensions/OpenStackManager/includes/OpenStackNovaUser.php:46
22:54:27 /workspace/src/extensions/OpenStackManager/includes/OpenStackNovaUser.php:31
22:54:27 /workspace/src/extensions/OpenStackManager/includes/OpenStackNovaUser.php:361
22:54:27 /workspace/src/includes/HookContainer/HookContainer.php:338
22:54:27 /workspace/src/includes/HookContainer/HookContainer.php:137
22:54:27 /workspace/src/includes/HookContainer/HookRunner.php:1928
22:54:27 /workspace/src/includes/preferences/DefaultPreferencesFactory.php:255
22:54:27 /workspace/src/includes/preferences/DefaultPreferencesFactory.php:1785
22:54:27 /workspace/src/includes/specials/SpecialPreferences.php:131
22:54:27 /workspace/src/includes/specials/SpecialPreferences.php:109
22:54:27 /workspace/src/tests/phpunit/includes/specials/SpecialPageExecutor.php:115
22:54:27 /workspace/src/tests/phpunit/includes/specials/SpecialPageExecutor.php:44
22:54:27 /workspace/src/tests/phpunit/structure/SpecialPageFatalTest.php:39
22:54:27 /workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:516

https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php80-noselenium-docker/761/console

Event Timeline

Change 840209 had a related patch set uploaded (by Majavah; author: Majavah):

[mediawiki/extensions/LdapAuthentication@master] Fail loudly on LDAP connection failure

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

taavi subscribed.

The failure is coming from LdapAuthentication's (lack of) error handling. Converting a return false; to raise an exception should in theory change the test error, but somehow it makes the tests pass?

Change 840209 merged by jenkins-bot:

[mediawiki/extensions/LdapAuthentication@master] Fail loudly on LDAP connection failure

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

Not sure why but it works now.

The failure is coming from LdapAuthentication's (lack of) error handling. Converting a return false; to raise an exception should in theory change the test error, but somehow it makes the tests pass?

The test is just asserting it doesn't fatal. The TypeError is fatal but the new RuntimeException is catchable. Thanks!