geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ladyva...@apache.org
Subject [51/51] [abbrv] geode git commit: GEODE-3113: Modify HARegionQueue test to use Awaitility vs. timeouts
Date Wed, 19 Jul 2017 18:05:09 GMT
GEODE-3113: Modify HARegionQueue test to use Awaitility vs. timeouts

* Modify test to use Awaitility (at most 60 seconds) vs. sleeps prior to checking expiration


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/f286244a
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/f286244a
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/f286244a

Branch: refs/heads/feature/GEODE-3113
Commit: f286244a864e3eb61bbb586b678d39e0227bd574
Parents: b673ff9
Author: Lynn Hughes-Godfrey <lhughesgodfrey@pivotal.io>
Authored: Tue Jul 18 13:48:24 2017 -0700
Committer: Lynn Hughes-Godfrey <lhughesgodfrey@pivotal.io>
Committed: Wed Jul 19 11:04:02 2017 -0700

----------------------------------------------------------------------
 .../geode/internal/cache/ha/HARQAddOperationJUnitTest.java    | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/f286244a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARQAddOperationJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARQAddOperationJUnitTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARQAddOperationJUnitTest.java
index 8459cf6..e624cae 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARQAddOperationJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARQAddOperationJUnitTest.java
@@ -21,11 +21,13 @@ import java.io.IOException;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.ha.HARegionQueue.MapWrapper;
 import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
 import org.apache.logging.log4j.Logger;
+import org.awaitility.Awaitility;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Ignore;
@@ -287,12 +289,11 @@ public class HARQAddOperationJUnitTest {
           eventsMap.get(threadId));
 
       // wait for some more time to allow expiry on data
-      Thread.sleep(16000);
-
       // After the expiry of the data , AvaialbleIds size should be 0,
       // entry
       // removed from Region, LastDispatchedWrapperSet should have size 0.
-      assertEquals(0, regionqueue.getRegion().entrySet(false).size());
+      Awaitility.await().atMost(60, TimeUnit.SECONDS)
+          .until(() -> assertEquals(0, regionqueue.getRegion().entrySet(false).size()));
       assertEquals(0, regionqueue.getAvalaibleIds().size());
       assertNull(regionqueue.getCurrentCounterSet(id1));
 


Mime
View raw message