DonalEvans commented on a change in pull request #5845:
URL: https://github.com/apache/geode/pull/5845#discussion_r542710577



##########
File path: 
geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDUnitTest.java
##########
@@ -467,8 +467,66 @@ public void 
testPRParallelPropagationWithGroupTransactionEventsSendsBatchesWithC
     assertEquals(0, v4List.get(5) + v5List.get(5) + v6List.get(5) + 
v7List.get(5));
     // events not queued conflated:
     assertEquals(0, v4List.get(7) + v5List.get(7) + v6List.get(7) + 
v7List.get(7));
+    // batches with incomplete transactions
+    assertEquals(0, (int) v4List.get(13));
+
+  }
+
+  @Test
+  public void 
testPRParallelPropagationWithGroupTransactionEventsWithIncompleteTransactions() 
{
+    Integer lnPort = vm0.invoke(() -> 
WANTestBase.createFirstLocatorWithDSId(1));
+    Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, 
lnPort));
+
+    createCacheInVMs(nyPort, vm2);
+    createReceiverInVMs(vm2);
+
+    int dispThreads = 2;
+    createSenderInVm(lnPort, vm4, dispThreads);
+
+    createReceiverPR(vm2, 0);
+
+    createSenderPRInVM(0, vm4);
+
+    startSenderInVMs("ln", vm4);
+
+    // Adding events in transactions
+    final Map<Object, Object> keyValue = new HashMap<>();
+    int entries = 30;
+    for (int i = 0; i < entries; i++) {
+      keyValue.put(i, i);
+    }
+
+    int entriesPerTransaction = 3;
+    vm4.invoke(
+        () -> WANTestBase.doPutsInsideTransactions(testName, keyValue, 
entriesPerTransaction));
+
+    vm4.invoke(() -> WANTestBase.validateRegionSize(testName, entries));
+
+    ArrayList<Integer> v4List =
+        (ArrayList<Integer>) vm4.invoke(() -> WANTestBase.getSenderStats("ln", 
0));
+
+    int batches = 4;

Review comment:
       I looked at the test a bit closer and now see that the batch size is set 
as 10 in the `createSenderInVm()` method, so it might be good to add a comment 
explaining that 4 batches are expected because each dispatcher thread will send 
2 batches, since it's not immediately obvious when looking at the test what the 
batch size is, or why 30 entries with a batch size of 10 would result in 4 
batches rather than 3.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to