mivanac commented on a change in pull request #7422: URL: https://github.com/apache/geode/pull/7422#discussion_r824500244
########## File path: geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java ########## @@ -2231,6 +2240,102 @@ public void testpersistentWanGateway_restartSenderWithCleanQueuesDelayed_expectN vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName(), 0)); } + + /** + * Enable persistence for region as well as GatewaySender and see if remote site receives all the + * events. + */ + @Test + public void testPersistentPartitionedRegionWithGatewaySenderStartStopEventsDispatchedNoChangesInQueue() { + Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1)); + Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort)); + + createCacheInVMs(nyPort, vm2, vm3); + + createCacheInVMs(lnPort, vm4, vm5); + vm4.invoke(() -> setNumDispatcherThreadsForTheRun(5)); + vm5.invoke(() -> setNumDispatcherThreadsForTheRun(5)); + + vm4.invoke(() -> WANTestBase.createSender("ln", 2, true, 100, 10, false, true, null, false)); + vm5.invoke(() -> WANTestBase.createSender("ln", 2, true, 100, 10, false, true, null, false)); + + vm4.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, + 100, isOffHeap())); + vm5.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, + 100, isOffHeap())); + + + vm2.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), null, 1, + 100, isOffHeap())); + vm3.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), null, 1, + 100, isOffHeap())); + + vm4.invoke(() -> WANTestBase.doPuts(getTestMethodName(), 1000)); + + + vm4.invoke(() -> WANTestBase.stopSender("ln")); + vm5.invoke(() -> WANTestBase.stopSender("ln")); + + logger.info("Stopped all the senders."); + + // wait for senders to stop + vm4.invoke(waitForSenderNonRunnable()); + vm5.invoke(waitForSenderNonRunnable()); + + createReceiverInVMs(vm2, vm3); + + AsyncInvocation inv1 = vm4.invokeAsync(startSenderRunnable()); + AsyncInvocation inv2 = vm5.invokeAsync(startSenderRunnable()); + + try { + inv1.join(); + inv2.join(); + } catch (InterruptedException e) { + e.printStackTrace(); + fail(); + } Review comment: Updated. It is important to start senders simultaneously, and not sequentially. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@geode.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org