You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by nn...@apache.org on 2021/08/23 22:34:26 UTC

[geode] branch support/1.14 updated: GEODE-9071: Add wait before check cq listener invocations. (#6785)

This is an automated email from the ASF dual-hosted git repository.

nnag pushed a commit to branch support/1.14
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/support/1.14 by this push:
     new ce6b128  GEODE-9071: Add wait before check cq listener invocations. (#6785)
ce6b128 is described below

commit ce6b1280ba57fbdbd1bb52104f71516288635257
Author: Eric Shu <es...@pivotal.io>
AuthorDate: Mon Aug 23 10:09:56 2021 -0700

    GEODE-9071: Add wait before check cq listener invocations. (#6785)
    
    * Cq events sent to client asynchronously. Need to wait events are
        all delivered.
    
    (cherry picked from commit 018fb585b1750a3186ad4693744ed5630d869182)
---
 .../cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java    | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java b/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java
index 6d2e979..6efc4e3 100644
--- a/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java
+++ b/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/PartitionedRegionCqQueryDUnitTest.java
@@ -16,6 +16,7 @@ package org.apache.geode.cache.query.cq.dunit;
 
 import static org.apache.geode.cache.Region.SEPARATOR;
 import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
 import static org.apache.geode.test.dunit.Assert.assertEquals;
 import static org.apache.geode.test.dunit.Assert.assertFalse;
 import static org.apache.geode.test.dunit.Assert.assertNotNull;
@@ -183,7 +184,8 @@ public class PartitionedRegionCqQueryDUnitTest extends JUnit4CacheTestCase {
           .isNotNull();
       CqQueryTestListener cqListener =
           (CqQueryTestListener) cqQuery.getCqAttributes().getCqListener();
-      assertThat(cqListener.getTotalEventCount()).isEqualTo(numObjects - 1);
+      await().untilAsserted(
+          () -> assertThat(cqListener.getTotalEventCount()).isEqualTo(numObjects - 1));
     });
 
     cqHelper.closeClient(client);
@@ -248,7 +250,8 @@ public class PartitionedRegionCqQueryDUnitTest extends JUnit4CacheTestCase {
           .isNotNull();
       CqQueryTestListener cqListener =
           (CqQueryTestListener) cqQuery.getCqAttributes().getCqListener();
-      assertThat(cqListener.getTotalEventCount()).isEqualTo(numObjects - 1);
+      await().untilAsserted(
+          () -> assertThat(cqListener.getTotalEventCount()).isEqualTo(numObjects - 1));
     });
 
     cqHelper.closeClient(client);