Skip to content

Commit

Permalink
GEODE-6347: Setting tolerance to 1 for Cache XML tests (apache#3163)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmellawatt authored Feb 5, 2019
1 parent 5e97425 commit 5b7347d
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
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;
Expand All @@ -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 =
Expand All @@ -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();
}

Expand All @@ -74,6 +78,11 @@ public final void preTearDownCacheTestCase() throws Exception {
waitForNoRebalancing();
Invoke.invokeInEveryVM(CacheXmlTestCase::waitForNoRebalancing);

if (previousMemoryEventTolerance != null) {
System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "memoryEventTolerance",
previousMemoryEventTolerance);
}

super.preTearDownCacheTestCase();
}

Expand Down

0 comments on commit 5b7347d

Please sign in to comment.