geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ladyva...@apache.org
Subject geode git commit: GEODE-3113: Modify HARegionQueue test to use Awaitility vs. timeouts [Forced Update!]
Date Thu, 20 Jul 2017 00:02:00 GMT
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-3113 f286244a8 -> 16fda7bee (forced update)


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
* remove obsolete comment


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

Branch: refs/heads/feature/GEODE-3113
Commit: 16fda7bee6a3dc6214ca40d85371eef79e759b94
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 17:00:32 2017 -0700

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


http://git-wip-us.apache.org/repos/asf/geode/blob/16fda7be/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..71716dd 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;
@@ -286,13 +288,11 @@ public class HARQAddOperationJUnitTest {
           "ThreadIdentifier removed itself through expiry even though data was lying in the
queue",
           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