You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by mc...@apache.org on 2019/02/05 22:33:24 UTC

[geode] branch develop updated: GEODE-6347: Setting tolerance to 1 for Cache XML tests (#3163)

This is an automated email from the ASF dual-hosted git repository.

mcmellawatt pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 5b7347d  GEODE-6347: Setting tolerance to 1 for Cache XML tests (#3163)
5b7347d is described below

commit 5b7347d9ec98227462c09b8187ec21f1679f9637
Author: Ryan McMahon <rm...@pivotal.io>
AuthorDate: Tue Feb 5 14:33:09 2019 -0800

    GEODE-6347: Setting tolerance to 1 for Cache XML tests (#3163)
---
 .../src/main/java/org/apache/geode/cache30/CacheXmlTestCase.java | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/geode-dunit/src/main/java/org/apache/geode/cache30/CacheXmlTestCase.java b/geode-dunit/src/main/java/org/apache/geode/cache30/CacheXmlTestCase.java
index b1aa608..77b147f 100644
--- a/geode-dunit/src/main/java/org/apache/geode/cache30/CacheXmlTestCase.java
+++ b/geode-dunit/src/main/java/org/apache/geode/cache30/CacheXmlTestCase.java
@@ -32,6 +32,7 @@ import org.apache.commons.io.FileUtils;
 import org.junit.Rule;
 
 import org.apache.geode.cache.Cache;
+import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.xmlcache.CacheCreation;
 import org.apache.geode.internal.cache.xmlcache.CacheXml;
@@ -50,6 +51,7 @@ public class CacheXmlTestCase extends JUnit4CacheTestCase {
 
   /** set this to false if a test needs a non-loner distributed system */
   static boolean lonerDistributedSystem = true;
+  private static String previousMemoryEventTolerance;
 
   @Rule
   public DistributedRestoreSystemProperties restoreSystemProperties =
@@ -63,6 +65,8 @@ public class CacheXmlTestCase extends JUnit4CacheTestCase {
 
   @Override
   public final void postSetUp() throws Exception {
+    previousMemoryEventTolerance =
+        System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "memoryEventTolerance", "1");
     disconnectAllFromDS();
   }
 
@@ -74,6 +78,11 @@ public class CacheXmlTestCase extends JUnit4CacheTestCase {
     waitForNoRebalancing();
     Invoke.invokeInEveryVM(CacheXmlTestCase::waitForNoRebalancing);
 
+    if (previousMemoryEventTolerance != null) {
+      System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "memoryEventTolerance",
+          previousMemoryEventTolerance);
+    }
+
     super.preTearDownCacheTestCase();
   }