You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ji...@apache.org on 2016/07/06 22:59:25 UTC

[02/10] incubator-geode git commit: GEODE-1586: Re-arranged the validation sequence in the test case. * Validate that the receiver region side before validating that the sender's queues are drained. * This gives the sender's queues additional time to d

GEODE-1586: Re-arranged the validation sequence in the test case.
	* Validate that the receiver region side before validating that the sender's queues are drained.
	* This gives the sender's queues additional time to drain.
	* size() in CustomEntryConcurrentHashMap is written such that if the counts do not change in two iterations, that value is returned as size.
	* This size() will not be always consistent.
	* Only the test can be modified to ensure that the queues get enough time to drain out.

	This closes #189


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

Branch: refs/heads/feature/GEODE-1571
Commit: ff2637d7aeadd0beda581d5c2422803f167021e1
Parents: c065b6a
Author: nabarun <nn...@pivotal.io>
Authored: Thu Jun 30 10:47:16 2016 -0700
Committer: nabarun <nn...@pivotal.io>
Committed: Wed Jul 6 09:36:23 2016 -0700

----------------------------------------------------------------------
 ...oncurrentParallelGatewaySenderDUnitTest.java | 22 +++++++++++++-------
 1 file changed, 14 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ff2637d7/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
index 5790a8d..ee9edf8 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDUnitTest.java
@@ -16,6 +16,7 @@
  */
 package com.gemstone.gemfire.internal.cache.wan.concurrent;
 
+import com.jayway.awaitility.Awaitility;
 import org.junit.experimental.categories.Category;
 import org.junit.Test;
 
@@ -40,6 +41,7 @@ import com.gemstone.gemfire.test.dunit.Wait;
 
 import java.net.SocketException;
 import java.util.Set;
+import java.util.concurrent.TimeUnit;
 
 /**
  * Test the functionality of ParallelGatewaySender with multiple dispatchers.
@@ -621,29 +623,33 @@ public class ConcurrentParallelGatewaySenderDUnitTest extends WANTestBase {
         getTestMethodName() + "_PR", null, 1, 100, isOffHeap() ));
 
     AsyncInvocation inv1 = vm7.invokeAsync(() -> WANTestBase.doPuts( getTestMethodName() + "_PR", 5000 ));
-    Wait.pause(500);
+    vm2.invoke(() -> Awaitility.await().atMost(30000, TimeUnit.MILLISECONDS).until(() ->
+      assertEquals("Failure in waiting for at least 10 events to be received by the receiver",
+        true, (getRegionSize(getTestMethodName() + "_PR") > 10 ))));
     AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.killSender());
     AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase.doPuts( getTestMethodName() + "_PR", 10000 ));
-    Wait.pause(1500);
+    vm2.invoke(() -> Awaitility.await().atMost(30000, TimeUnit.MILLISECONDS).until(() ->
+      assertEquals("Failure in waiting for additional 2000 events to be received by the receiver ",
+        true,getRegionSize(getTestMethodName() + "_PR") > 7000 )));
     AsyncInvocation inv4 = vm5.invokeAsync(() -> WANTestBase.killSender());
     inv1.join();
     inv2.join();
     inv3.join();
     inv4.join();
-    
+
     vm6.invoke(() -> WANTestBase.validateRegionSize(
       getTestMethodName() + "_PR", 10000 ));
     vm7.invoke(() -> WANTestBase.validateRegionSize(
       getTestMethodName() + "_PR", 10000 ));
+
+    vm2.invoke(() -> WANTestBase.validateRegionSize(
+      getTestMethodName() + "_PR", 10000 ));
+    vm3.invoke(() -> WANTestBase.validateRegionSize(
+      getTestMethodName() + "_PR", 10000 ));
     
     //verify all buckets drained on the sender nodes that up and running.
     vm6.invoke(() -> WANTestBase.validateParallelSenderQueueAllBucketsDrained("ln"));
     vm7.invoke(() -> WANTestBase.validateParallelSenderQueueAllBucketsDrained("ln"));
-
-    vm2.invoke(() -> WANTestBase.validateRegionSize(
-        getTestMethodName() + "_PR", 10000 ));
-    vm3.invoke(() -> WANTestBase.validateRegionSize(
-        getTestMethodName() + "_PR", 10000 ));
   }
   
   @Test