Aaron Schulz has uploaded a new change for review.

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

Change subject: Carry over testing DBLoadBalancer to avoid max_connections 
errors
......................................................................

Carry over testing DBLoadBalancer to avoid max_connections errors

Change-Id: I2ac47f76b43613370fed9f911dca1df6c4b2cbd3
---
M tests/phpunit/MediaWikiTestCase.php
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/27/312027/1

diff --git a/tests/phpunit/MediaWikiTestCase.php 
b/tests/phpunit/MediaWikiTestCase.php
index cfeb44f..8fa1263 100644
--- a/tests/phpunit/MediaWikiTestCase.php
+++ b/tests/phpunit/MediaWikiTestCase.php
@@ -535,7 +535,12 @@
                $this->restoreLoggers();
 
                if ( self::$serviceLocator && MediaWikiServices::getInstance() 
!== self::$serviceLocator ) {
+                       $lbf = 
MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
                        MediaWikiServices::forceGlobalInstance( 
self::$serviceLocator );
+                       // Carry over the LBFactory/LoadBalancer to avoid 
exhausting the max connection
+                       // limit and wasting time connecting and reconning 
again and again
+                       $this->setService( 'DBLoadBalancerFactory', $lbf );
+                       $this->setService( 'DBLoadBalancer', $lbf->getMainLB() 
);
                }
 
                // TODO: move global state into MediaWikiServices

-- 
To view, visit https://gerrit.wikimedia.org/r/312027
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ac47f76b43613370fed9f911dca1df6c4b2cbd3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to