geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasonhu...@apache.org
Subject geode git commit: GEODE-2233: Improved test shuttingOneSenderInAVMShouldNotAffectOthersBatchRemovalThread
Date Thu, 29 Dec 2016 17:25:40 GMT
Repository: geode
Updated Branches:
  refs/heads/develop e667e82d0 -> ad09e9f4a


GEODE-2233: Improved test shuttingOneSenderInAVMShouldNotAffectOthersBatchRemovalThread


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

Branch: refs/heads/develop
Commit: ad09e9f4a47fc849b71715da5cdeae5f6b030797
Parents: e667e82
Author: Jason Huynh <huynhja@gmail.com>
Authored: Wed Dec 21 11:26:52 2016 -0800
Committer: Jason Huynh <huynhja@gmail.com>
Committed: Thu Dec 29 09:22:28 2016 -0800

----------------------------------------------------------------------
 ...allelGatewaySenderOperation_2_DUnitTest.java | 35 ++++++++++++++------
 1 file changed, 25 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/ad09e9f4/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_2_DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_2_DUnitTest.java
b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_2_DUnitTest.java
index 3ed867a..6c8ea79 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_2_DUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_2_DUnitTest.java
@@ -77,7 +77,6 @@ public class ConcurrentParallelGatewaySenderOperation_2_DUnitTest extends
WANTes
         false));
     vm4.invoke(() -> WANTestBase.createReceiver());
 
-
     vm2.invoke(() -> WANTestBase.startSender("ln"));
     vm2.invoke(() -> WANTestBase.startSender("ln2"));
 
@@ -89,21 +88,37 @@ public class ConcurrentParallelGatewaySenderOperation_2_DUnitTest extends
WANTes
     vm3.invoke(() -> WANTestBase.startSender("ln"));
     vm3.invoke(() -> WANTestBase.startSender("ln2"));
 
-    vm2.invokeAsync(() -> {
-      WANTestBase.doPuts(getTestMethodName() + "_PR", 10000);
+    vm2.invoke(() -> WANTestBase.waitForSenderRunningState("ln"));
+    vm2.invoke(() -> WANTestBase.waitForSenderRunningState("ln2"));
+    vm3.invoke(() -> WANTestBase.waitForSenderRunningState("ln"));
+    vm3.invoke(() -> WANTestBase.waitForSenderRunningState("ln2"));
+
+    AsyncInvocation asyncPuts = vm2.invokeAsync(() -> {
+      WANTestBase.doPuts(getTestMethodName() + "_PR", 1000);
+    });
+    // Guarantee some entries are in the queue even if the asyncPuts thread is slow
+    vm2.invoke(() -> {
+      WANTestBase.doPuts(getTestMethodName() + "_PR", 100);
     });
-    vm4.invoke(() -> Awaitility.await().atMost(20, TimeUnit.SECONDS).until(
-        () -> assertEquals(true, WANTestBase.getRegionSize(getTestMethodName() + "_PR")
> 100)));
-    vm2.invoke(() -> WANTestBase.stopSender("ln"));
+    vm2.invoke(() -> Awaitility.await().atMost(30, TimeUnit.SECONDS)
+        .until(() -> WANTestBase.getSenderStats("ln", -1).get(3) > 0));
+    vm2.invoke(() -> WANTestBase.stopSender("ln")); // Things have dispatched
+    // Dispatch additional values
+    vm2.invoke(() -> {
+      WANTestBase.doPutsFrom(getTestMethodName() + "_PR", 1000, 1100);
+    });
+
+    Awaitility.await().atMost(60, TimeUnit.SECONDS).until(() -> asyncPuts.isDone());
 
     vm2.invoke(() -> Awaitility.await().atMost(20, TimeUnit.SECONDS)
-        .until(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_PR", 10000)));
+        .until(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_PR", 1100)));
     vm4.invoke(() -> Awaitility.await().atMost(20, TimeUnit.SECONDS)
-        .until(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_PR", 10000)));
+        .until(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_PR", 1100)));
 
     vm3.invoke(() -> {
-      Awaitility.await().atMost(20, TimeUnit.SECONDS)
-          .until(() -> WANTestBase.getQueueContentSize("ln", true));
+      Awaitility.await().atMost(60, TimeUnit.SECONDS)
+          .until(() -> assertTrue(WANTestBase.getQueueContentSize("ln2", true) + " was
the size",
+              WANTestBase.getQueueContentSize("ln2", true) == 0));
     });
   }
 


Mime
View raw message