jinmeiliao commented on code in PR #7628:
URL: https://github.com/apache/geode/pull/7628#discussion_r860267392


##########
geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/CQDistributedTest.java:
##########
@@ -87,6 +91,47 @@ public void before() throws Exception {
     cqa = cqaf.create();
   }
 
+  @Rule
+  public ExecutorServiceRule executor = new ExecutorServiceRule();
+
+  @Test
+  // Before the fix, this test will reproduce pretty consistently if we put a 
sleep statement before
+  // we do localFP.addToFilterProfileQueue in 
FilterProfile$OperationMessage.process().
+  public void filterProfileUpdate() throws Exception {
+    MemberVM newServer = clusterStartupRule.startServerVM(3, 
locator.getPort());
+
+    // create 10 cqs to begin with
+    for (int i = 0; i < 10; i++) {
+      qs.newCq("query_" + i, "Select * from " + SEPARATOR + "region r where 
r.ID = " + i, cqa)
+          .execute();
+    }
+
+    AsyncInvocation regionCreate = newServer.invokeAsync(() -> {
+      ClusterStartupRule.memberStarter.createRegion(RegionShortcut.PARTITION, 
"region");
+    });
+
+    Future<Void> createCqs = executor.submit(() -> {
+      for (int i = 10; i < 100; i++) {
+        qs.newCq("query_" + i, "Select * from " + SEPARATOR + "region r where 
r.ID = " + i, cqa)
+            .execute();
+      }
+    });
+
+    regionCreate.await();
+    createCqs.get();
+
+    newServer.invoke(() -> {
+      Region regionOnServer = 
ClusterStartupRule.getCache().getRegion("region");
+      for (int i = 0; i < 100; i++) {
+        regionOnServer.put(i, new Portfolio(i));
+      }
+    });
+
+    // make sure all cq's will get its own event, so total events = total # of 
cqs.
+    await().atMost(10, TimeUnit.SECONDS)

Review Comment:
   Oh, this needs to be removed, added only for local testing so that it failed 
sooner.



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

Reply via email to