geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject [65/70] incubator-geode git commit: GEODE-867: Undoing changes to pauseSender to wait for the pause
Date Thu, 28 Jan 2016 18:14:07 GMT
GEODE-867: Undoing changes to pauseSender to wait for the pause

GEODE-864 changed WANTestBase.pauseSender to wait for the sender to
pause. But apparently in
ConcurrentSerialGatewaySenderOperationsDUnitTest the sender never
actually pauses, causing a hang in precheckin.

Temporarily undoing the changes for GEODE-864 and just changing the one
test to use pauseSenderAndWaitForDispatcher instead. That will leave
GEODE-864 fixed but also fix the hang until we can figure out why the
sender is not paused in this case.


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

Branch: refs/heads/develop
Commit: 09bd5307994bd970bdf3bf4f1d5f302021e8b8e6
Parents: a724951
Author: Dan Smith <upthewaterspout@apache.org>
Authored: Wed Jan 27 11:16:40 2016 -0800
Committer: Dan Smith <upthewaterspout@apache.org>
Committed: Wed Jan 27 11:16:40 2016 -0800

----------------------------------------------------------------------
 .../gemfire/internal/cache/wan/WANTestBase.java | 23 ++++++++++++++++++--
 ...arallelGatewaySenderOperationsDUnitTest.java |  8 +++----
 .../ParallelWANConflationDUnitTest.java         |  8 +++----
 3 files changed, 29 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/09bd5307/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java
----------------------------------------------------------------------
diff --git a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java
b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java
index 5539eb1..0c32d1f 100644
--- a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java
+++ b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java
@@ -2162,14 +2162,33 @@ public class WANTestBase extends DistributedTestCase{
         }
       }
       sender.pause();
-      ((AbstractGatewaySender) sender).getEventProcessor().waitForDispatcherToPause();
-      
     }
     finally {
       exp.remove();
       exln.remove();
     }
   }
+      
+  public static void pauseSenderAndWaitForDispatcherToPause(String senderId) {
+    final ExpectedException exln = addExpectedException("Could not connect");
+    ExpectedException exp = addExpectedException(ForceReattemptException.class
+        .getName());
+    try {
+      Set<GatewaySender> senders = cache.getGatewaySenders();
+      GatewaySender sender = null;
+      for (GatewaySender s : senders) {
+        if (s.getId().equals(senderId)) {
+          sender = s;
+          break;
+        }
+      }
+      sender.pause();
+      ((AbstractGatewaySender)sender).getEventProcessor().waitForDispatcherToPause();
+    } finally {
+      exp.remove();
+      exln.remove();
+    }    
+  }
   
   public static void resumeSender(String senderId) {
     final ExpectedException exln = addExpectedException("Could not connect");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/09bd5307/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
index 3d0eb5b..19f6c4b 100644
--- a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
+++ b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java
@@ -210,10 +210,10 @@ public class ParallelGatewaySenderOperationsDUnitTest extends WANTestBase
{
     vm4.invoke(WANTestBase.class, "doPuts", new Object[] { testName + "_PR", 100 });
     
     //now, pause all of the senders
-    vm4.invoke(WANTestBase.class, "pauseSender", new Object[] { "ln" });
-    vm5.invoke(WANTestBase.class, "pauseSender", new Object[] { "ln" });
-    vm6.invoke(WANTestBase.class, "pauseSender", new Object[] { "ln" });
-    vm7.invoke(WANTestBase.class, "pauseSender", new Object[] { "ln" });
+    vm4.invoke(WANTestBase.class, "pauseSenderAndWaitForDispatcherToPause", new Object[]
{ "ln" });
+    vm5.invoke(WANTestBase.class, "pauseSenderAndWaitForDispatcherToPause", new Object[]
{ "ln" });
+    vm6.invoke(WANTestBase.class, "pauseSenderAndWaitForDispatcherToPause", new Object[]
{ "ln" });
+    vm7.invoke(WANTestBase.class, "pauseSenderAndWaitForDispatcherToPause", new Object[]
{ "ln" });
     
     //SECOND RUN: keep one thread doing puts to the region
     vm4.invokeAsync(WANTestBase.class, "doPuts", new Object[] { testName + "_PR", 1000 });

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/09bd5307/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANConflationDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANConflationDUnitTest.java
b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANConflationDUnitTest.java
index 763b9c4..bce63f5 100644
--- a/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANConflationDUnitTest.java
+++ b/gemfire-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANConflationDUnitTest.java
@@ -430,10 +430,10 @@ public class ParallelWANConflationDUnitTest extends WANTestBase {
   }
 
   protected void pauseSenders() {
-    vm4.invoke(() ->pauseSender( "ln" ));
-    vm5.invoke(() ->pauseSender( "ln" ));
-    vm6.invoke(() ->pauseSender( "ln" ));
-    vm7.invoke(() ->pauseSender( "ln" ));
+    vm4.invoke(() ->pauseSenderAndWaitForDispatcherToPause( "ln" ));
+    vm5.invoke(() ->pauseSenderAndWaitForDispatcherToPause( "ln" ));
+    vm6.invoke(() ->pauseSenderAndWaitForDispatcherToPause( "ln" ));
+    vm7.invoke(() ->pauseSenderAndWaitForDispatcherToPause( "ln" ));
   }
 
   protected void startSenders() {


Mime
View raw message