@Test
  public void whenBatchBasedOnTimeOnlyThenQueueShouldNotDispatchUntilIntervalIsHit() {
    Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
    Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));
    int batchIntervalTime = 5000;

    // Create receiver and region
    vm2.invoke(() -> WANTestBase.createCache(nyPort));
    vm2.invoke(
        () -> WANTestBase.createPartitionedRegion(getTestMethodName() + "_PR", null, 0, 10,
            isOffHeap()));
    vm2.invoke(WANTestBase::createReceiver);
    vm2.invoke(() -> WANTestBase.addListenerOnRegion(getTestMethodName() + "_PR"));

    // Create sender with batchSize disabled
    vm4.invoke(() -> WANTestBase.createCache(lnPort));
    String senderId = "ln";
    final String builder = String.valueOf(senderId);
    vm4.invoke(() -> {
      InternalGatewaySenderFactory gateway =
          (InternalGatewaySenderFactory) cache.createGatewaySenderFactory();
      gateway.setParallel(true);
      gateway.setMaximumQueueMemory(100);
      gateway.setBatchSize(RegionQueue.BATCH_BASED_ON_TIME_ONLY);
      gateway.setBatchConflationEnabled(true);
      gateway.setDispatcherThreads(5);
      gateway.setBatchTimeInterval(batchIntervalTime);
      gateway.create(senderId, 2);
    });

    // Create region with the sender ids
    vm4.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + "_PR",
        builder, 0, 10, isOffHeap()));

    // Do puts
    int numPuts = 100;
    vm4.invoke(() -> WANTestBase.doPuts(getTestMethodName() + "_PR", numPuts));

    // attempt to prove the absence of a dispatch/ prove a dispatch has not occurred
    // will verify that no events have occurred over a period of time less than batch interval but
    // more than enough
    // for a regular dispatch to have occurred
    vm2.invoke(() -> {
      long startTime = System.currentTimeMillis();
      while (System.currentTimeMillis() - startTime < batchIntervalTime - 1000) {
        assertEquals(0, listener1.getNumEvents());
      }
    });

    // Verify receiver listener events
    vm2.invoke(() -> WANTestBase.verifyListenerEvents(numPuts));
  }
Enable persistence for GatewaySender. Pause the sender and do some puts in local region. Close
the local site and rebuild the region and sender from disk store. Dispatcher should not start
dispatching events recovered from persistent sender. Check if the remote site receives all the
events. Below test is disabled intentionally 1> In this release 8.0, for rolling upgrade
support queue name is changed to old style 2>Common parallel sender for different non colocated
regions is not supported in 8.0 so no need to bother about
ParallelGatewaySenderQueue#convertPathToName 3> We have to enabled it in next release 4>
Version based rolling upgrade support should be provided. based on the version of the gemfire
QSTRING should be used between 8.0 and version prior to 8.0
geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/CommonParallelGatewaySenderDUnitTest.java