Tobias Gritschacher has submitted this change and it was merged.

Change subject: Only resetEntities once in GetEntitiesTest
......................................................................


Only resetEntities once in GetEntitiesTest

This reduces the run time of these tests by more than 6/7
on my machine.

Change-Id: Iff84e12bf4a10b55713cde0241526064ee8a7bce
---
M repo/tests/phpunit/includes/api/GetEntitiesTest.php
1 file changed, 7 insertions(+), 2 deletions(-)

Approvals:
  Tobias Gritschacher: Verified
  Daniel Kinzler: Looks good to me, approved
  Addshore: Looks good to me, approved



diff --git a/repo/tests/phpunit/includes/api/GetEntitiesTest.php 
b/repo/tests/phpunit/includes/api/GetEntitiesTest.php
index a780fe1..f2a3104 100644
--- a/repo/tests/phpunit/includes/api/GetEntitiesTest.php
+++ b/repo/tests/phpunit/includes/api/GetEntitiesTest.php
@@ -52,8 +52,13 @@
        public function setup() {
                parent::setup();
 
-               // Nasty... we shouldn't need to do this. But apparently some 
other test spills bad state.
-               $this->resetEntities();
+               static $resetedEntities = false;
+               if ( !$resetedEntities ) {
+                       // Nasty... we shouldn't need to do this. But 
apparently some other test spills bad state.
+                       // Only do this once as the tests in here really 
shouldn't alter any entities
+                       $this->resetEntities();
+                       $resetedEntities = true;
+               }
        }
 
        /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iff84e12bf4a10b55713cde0241526064ee8a7bce
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to