From 0fdb213fe56e2ca73e29450c904e90291abba293 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Thu, 29 Aug 2019 14:10:46 +0300 Subject: [PATCH] Fix FileBackendGroup test for some configurations The expected value of FileBackendGroup::config()['srvCache'] was being obtained from MediaWikiServices::getLocalServerObjectCache(), but the class actually used ObjectCache::getLocalServerInstance( 'hash' ). It happens these are often the same, so it passed the gate-and-submit jobs, but it's causing failures on Travis CI. Follow-up to bd2a4395025, which added the failing test. Thanks to Krinkle for pointing out the failures on CI. Change-Id: I17651766f4ee2752dfcae9574d2538269dec4ebe --- .../filebackend/FileBackendGroupIntegrationTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/includes/filebackend/FileBackendGroupIntegrationTest.php b/tests/phpunit/includes/filebackend/FileBackendGroupIntegrationTest.php index ee3262c4e8..00fa1bb4a5 100644 --- a/tests/phpunit/includes/filebackend/FileBackendGroupIntegrationTest.php +++ b/tests/phpunit/includes/filebackend/FileBackendGroupIntegrationTest.php @@ -49,7 +49,11 @@ class FileBackendGroupIntegrationTest extends MediaWikiIntegrationTestCase { $services = MediaWikiServices::getInstance(); foreach ( $serviceMembers as $key => $name ) { - $this->$key = $services->getService( $name ); + if ( $key === 'srvCache' ) { + $this->$key = ObjectCache::getLocalServerInstance( 'hash' ); + } else { + $this->$key = $services->getService( $name ); + } } return FileBackendGroup::singleton(); -- 2.20.1