GEODE-1353: Added listeners to slow down the receiver. * Added a listener on after create to slow down the receiver. * This was done to avoid the need for a very large number of puts. * When region size is more than 5 it can initiate the destroy region * While the puts have been reduced to 2000 from 20,000 * This will make sure the queue is not empty.
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/56836e59 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/56836e59 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/56836e59 Branch: refs/heads/feature/GEODE-1874 Commit: 56836e59f39a273432b6e64904c41c7854f6446f Parents: 5c50954 Author: nabarun <n...@pivotal.io> Authored: Tue Oct 4 16:21:26 2016 -0700 Committer: nabarun <n...@pivotal.io> Committed: Tue Oct 18 14:13:19 2016 -0700 ---------------------------------------------------------------------- .../wan/serial/SerialWANStatsDUnitTest.java | 43 ++++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/56836e59/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANStatsDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANStatsDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANStatsDUnitTest.java index 4db4890..ceca847 100644 --- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANStatsDUnitTest.java +++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANStatsDUnitTest.java @@ -379,54 +379,61 @@ public class SerialWANStatsDUnitTest extends WANTestBase { * 1 region and sender configured on local site and 1 region and a * receiver configured on remote site. Puts to the local region are in progress. * Remote region is destroyed in the middle. + * + * Better fix : slowed down the receiver after every create event, So a huge number of puts is not required. + * * * @throws Exception */ - @Category(FlakyTest.class) // GEODE-1353 @Test public void testReplicatedSerialPropagationWithRemoteRegionDestroy() throws Exception { - int numEntries = 20000; + int numEntries = 2000; Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 )); Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort )); //these are part of remote site vm2.invoke(() -> WANTestBase.createCache( nyPort )); + + //create one RR (RR_1) on remote site + vm2.invoke(() -> WANTestBase.createReplicatedRegion( + testName + "_RR_1", null, isOffHeap() )); + + vm2.invoke(() -> WANTestBase.createReceiver()); + //This slows down the receiver + vm2.invoke(() -> addListenerToSleepAfterCreateEvent(1000, testName + "_RR_1")); + + //these are part of local site vm4.invoke(() -> WANTestBase.createCache( lnPort )); vm5.invoke(() -> WANTestBase.createCache( lnPort )); vm6.invoke(() -> WANTestBase.createCache( lnPort )); vm7.invoke(() -> WANTestBase.createCache( lnPort )); + //create one RR (RR_1) on local site + vm4.invoke(() -> WANTestBase.createReplicatedRegion( + testName + "_RR_1", "ln", isOffHeap() )); + vm5.invoke(() -> WANTestBase.createReplicatedRegion( + testName + "_RR_1", "ln", isOffHeap() )); + vm6.invoke(() -> WANTestBase.createReplicatedRegion( + testName + "_RR_1", "ln", isOffHeap() )); + vm7.invoke(() -> WANTestBase.createReplicatedRegion( + testName + "_RR_1", "ln", isOffHeap() )); + //senders are created on local site vm4.invoke(() -> WANTestBase.createSender( "ln", 2, false, 100, 100, false, false, null, true )); vm5.invoke(() -> WANTestBase.createSender( "ln", 2, false, 100, 100, false, false, null, true )); - //create one RR (RR_1) on remote site - vm2.invoke(() -> WANTestBase.createReplicatedRegion( - testName + "_RR_1", null, isOffHeap() )); - //This is to cause a scenario where we have received at least X events and want to slow the receiver - vm2.invoke(() -> WANTestBase.longPauseAfterNumEvents(500, 200)); //start the senders on local site startSenderInVMs("ln", vm4, vm5); - //create one RR (RR_1) on local site - vm4.invoke(() -> WANTestBase.createReplicatedRegion( - testName + "_RR_1", "ln", isOffHeap() )); - vm5.invoke(() -> WANTestBase.createReplicatedRegion( - testName + "_RR_1", "ln", isOffHeap() )); - vm6.invoke(() -> WANTestBase.createReplicatedRegion( - testName + "_RR_1", "ln", isOffHeap() )); - vm7.invoke(() -> WANTestBase.createReplicatedRegion( - testName + "_RR_1", "ln", isOffHeap() )); - //start puts in RR_1 in another thread AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts( testName + "_RR_1", numEntries )); //destroy RR_1 in remote site - vm2.invoke(() -> WANTestBase.destroyRegion( testName + "_RR_1", 500)); + vm2.invoke(() -> WANTestBase.destroyRegion( testName + "_RR_1", 5)); try { inv1.join();