This is an automated email from the ASF dual-hosted git repository. zhouxj pushed a commit to branch feature/GEODE-5144 in repository https://gitbox.apache.org/repos/asf/geode.git
commit aa299bd34641bb8415cca21d29e121bee3ce1b9d Author: zhouxh <gz...@pivotal.io> AuthorDate: Thu May 10 16:10:24 2018 -0700 GEODE-5144: The test should wait for secondary queue to drain remove the test only method --- .../geode/internal/cache/wan/AbstractGatewaySender.java | 8 -------- .../org/apache/geode/internal/cache/wan/WANTestBase.java | 7 +++---- .../wan/serial/SerialWANPropagationsFeatureDUnitTest.java | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySender.java b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySender.java index 1027582..123534a 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySender.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySender.java @@ -728,14 +728,6 @@ public abstract class AbstractGatewaySender implements GatewaySender, Distributi return null; } - public Set<RegionQueue> getQueuesForConcurrentSerialGatewaySender() { - if (this.eventProcessor != null - && (this.eventProcessor instanceof ConcurrentSerialGatewaySenderEventProcessor)) { - return ((ConcurrentSerialGatewaySenderEventProcessor) this.eventProcessor).getQueues(); - } - return null; - } - protected void waitForRunningStatus() { synchronized (this.eventProcessor.runningStateLock) { while (this.eventProcessor.getException() == null && this.eventProcessor.isStopped()) { diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/WANTestBase.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/WANTestBase.java index cc51acf..7bf7047 100644 --- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/WANTestBase.java +++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/WANTestBase.java @@ -3113,7 +3113,7 @@ public class WANTestBase extends DistributedTestCase { } final Set<RegionQueue> regionQueue; if (sender instanceof AbstractGatewaySender) { - regionQueue = ((AbstractGatewaySender) sender).getQueuesForConcurrentSerialGatewaySender(); + regionQueue = ((AbstractGatewaySender) sender).getQueues(); } else { regionQueue = null; } @@ -3132,7 +3132,7 @@ public class WANTestBase extends DistributedTestCase { } final Set<RegionQueue> regionQueue; if (!sender.isParallel()) { - regionQueue = ((AbstractGatewaySender) sender).getQueuesForConcurrentSerialGatewaySender(); + regionQueue = ((AbstractGatewaySender) sender).getQueues(); } else { regionQueue = null; } @@ -3397,8 +3397,7 @@ public class WANTestBase extends DistributedTestCase { senders.stream().filter(s -> s.getId().equals(senderId)).findFirst().get(); Awaitility.await().atMost(1, TimeUnit.MINUTES).until(() -> { - Set<RegionQueue> queues = - ((AbstractGatewaySender) sender).getQueuesForConcurrentSerialGatewaySender(); + Set<RegionQueue> queues = ((AbstractGatewaySender) sender).getQueues(); for (RegionQueue q : queues) { assertEquals(0, q.size()); } diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationsFeatureDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationsFeatureDUnitTest.java index 2d5e011..75980e6 100644 --- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationsFeatureDUnitTest.java +++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationsFeatureDUnitTest.java @@ -69,6 +69,8 @@ public class SerialWANPropagationsFeatureDUnitTest extends WANTestBase { vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 15, 240000)); vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 15, 240000)); + vm4.invoke(() -> WANTestBase.waitForConcurrentSerialSenderQueueToDrain("ln")); + vm5.invoke(() -> WANTestBase.waitForConcurrentSerialSenderQueueToDrain("ln")); } @Test @@ -105,6 +107,8 @@ public class SerialWANPropagationsFeatureDUnitTest extends WANTestBase { vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 1000)); vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 1000)); + vm4.invoke(() -> WANTestBase.waitForConcurrentSerialSenderQueueToDrain("ln")); + vm5.invoke(() -> WANTestBase.waitForConcurrentSerialSenderQueueToDrain("ln")); } @@ -142,6 +146,8 @@ public class SerialWANPropagationsFeatureDUnitTest extends WANTestBase { vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 1000)); vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 1000)); + vm4.invoke(() -> WANTestBase.waitForConcurrentSerialSenderQueueToDrain("ln")); + vm5.invoke(() -> WANTestBase.waitForConcurrentSerialSenderQueueToDrain("ln")); } @Test @@ -178,6 +184,8 @@ public class SerialWANPropagationsFeatureDUnitTest extends WANTestBase { vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 1000)); vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 1000)); + vm4.invoke(() -> WANTestBase.waitForConcurrentSerialSenderQueueToDrain("ln")); + vm5.invoke(() -> WANTestBase.waitForConcurrentSerialSenderQueueToDrain("ln")); } @Test @@ -215,6 +223,8 @@ public class SerialWANPropagationsFeatureDUnitTest extends WANTestBase { vm4.invoke(() -> WANTestBase.doPuts(getTestMethodName(), 1000)); vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName(), 800)); + vm4.invoke(() -> WANTestBase.waitForConcurrentSerialSenderQueueToDrain("ln")); + vm5.invoke(() -> WANTestBase.waitForConcurrentSerialSenderQueueToDrain("ln")); } @Test @@ -247,6 +257,8 @@ public class SerialWANPropagationsFeatureDUnitTest extends WANTestBase { vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName(), 800)); vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName(), 800)); + vm4.invoke(() -> WANTestBase.waitForConcurrentSerialSenderQueueToDrain("ln")); + vm5.invoke(() -> WANTestBase.waitForConcurrentSerialSenderQueueToDrain("ln")); } @Test @@ -285,5 +297,7 @@ public class SerialWANPropagationsFeatureDUnitTest extends WANTestBase { vm6.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName(), 1000)); vm7.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName(), 1000)); + vm4.invoke(() -> WANTestBase.waitForConcurrentSerialSenderQueueToDrain("ln")); + vm5.invoke(() -> WANTestBase.waitForConcurrentSerialSenderQueueToDrain("ln")); } } -- To stop receiving notification emails like this one, please contact zho...@apache.org.