gesterzhou commented on a change in pull request #6609:
URL: https://github.com/apache/geode/pull/6609#discussion_r651173685



##########
File path: 
geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/PutAllClientServerDistributedTest.java
##########
@@ -2485,6 +2485,109 @@ public void 
testEventIdOutOfOrderInPartitionRegionSingleHop() {
     });
   }
 
+  /**
+   * The purpose of this test is to validate that when two servers of three in 
a cluster configured
+   * with a client doing singlehop, that the client which registered interest 
gets afterCreate
+   * messages for each
+   * entry in the putall.
+   * Further, we also check that the region size is correct on the remaining 
server.
+   *
+   * When the client has finished registerInterest to build the subscription 
queue, the servers
+   * should guarantee all the afterCreate events arrive.
+   *
+   */
+  @Test
+  public void 
testEventIdOutOfOrderInPartitionRegionSingleHopFromClientRegisteredInterest() {
+    VM server3 = client2;
+
+    int serverPort1 = server1.invoke(() -> new ServerBuilder()
+        .regionShortcut(PARTITION)
+        .create());
+
+    int serverPort2 = server2.invoke(() -> new ServerBuilder()
+        .regionShortcut(PARTITION)
+        .create());
+
+    int serverPort3 = server3.invoke(() -> new ServerBuilder()
+        .regionShortcut(PARTITION)
+        .create());
+
+    client1.invoke(() -> new ClientBuilder()
+        .prSingleHopEnabled(true)
+        .serverPorts(serverPort1, serverPort2, serverPort3)
+        .subscriptionAckInterval()
+        .subscriptionEnabled(true)
+        .subscriptionRedundancy()
+        .create());
+
+    new ClientBuilder()
+        .prSingleHopEnabled(true)
+        .serverPorts(serverPort1, serverPort2, serverPort3)
+        .subscriptionAckInterval()
+        .subscriptionEnabled(true)
+        .subscriptionRedundancy()
+        .create();
+
+    Region<String, TickerData> myRegion = 
getClientCache().getRegion(regionName);
+    myRegion.registerInterest("ALL_KEYS");
+
+    // do some putAll to get ClientMetaData for future putAll
+    client1.invoke(() -> doPutAll(getClientCache().getRegion(regionName), 
"key-", ONE_HUNDRED));
+    await().until(() -> myRegion.size() == ONE_HUNDRED);
+
+    // register interest and add listener
+    Counter clientCounter = new Counter("client");
+    myRegion.getAttributesMutator().addCacheListener(new 
CountingCacheListener<>(clientCounter));
+
+    // server1 and server2 will closeCache after created 10 keys

Review comment:
       This comments are from original test case. 
   




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