You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by mh...@apache.org on 2020/04/17 23:46:50 UTC

[geode] branch develop updated: GEODE-5428 (#4972)

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

mhanson pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new aab948a  GEODE-5428 (#4972)
aab948a is described below

commit aab948a5e6c82319a631c901a17cc01692da14c2
Author: mhansonp <ha...@vmware.com>
AuthorDate: Fri Apr 17 16:46:23 2020 -0700

    GEODE-5428 (#4972)
    
    * Made a few asserts await.
---
 .../cache/tier/sockets/DurableClientTestCase.java  | 23 +++++++++-------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/DurableClientTestCase.java b/geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/DurableClientTestCase.java
index b4ce7c7..7e8da53 100755
--- a/geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/DurableClientTestCase.java
+++ b/geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/DurableClientTestCase.java
@@ -16,6 +16,7 @@ package org.apache.geode.internal.cache.tier.sockets;
 
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
 import static java.util.concurrent.TimeUnit.MINUTES;
+import static org.apache.geode.internal.cache.tier.sockets.CacheServerTestUtil.getCache;
 import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.hamcrest.Matchers.notNullValue;
@@ -74,8 +75,6 @@ public class DurableClientTestCase extends DurableClientTestBase {
     final Properties jp = new Properties();
     jp.setProperty(GeodeGlossary.GEMFIRE_PREFIX + "SPECIAL_DURABLE", "true");
 
-
-
     try {
 
       server1Port = this.server1VM
@@ -518,16 +517,14 @@ public class DurableClientTestCase extends DurableClientTestBase {
     // Verify the durable client received the updates before failover
     this.checkListenerEvents(2, 1, -1, this.durableClientVM);
 
-    this.durableClientVM.invoke(new CacheSerializableRunnable("Get") {
-      @Override
-      public void run2() throws CacheException {
-
-        Region<Object, Object> region = CacheServerTestUtil.getCache().getRegion(regionName);
+    this.durableClientVM.invoke("Get", () -> {
+      await().untilAsserted(() -> {
+        Region<Object, Object> region = getCache().getRegion(regionName);
         assertThat(region).isNotNull();
 
         assertThat(region.getEntry("0")).isNull();
         assertThat(region.getEntry("2")).isNotNull();
-      }
+      });
     });
 
     // Stop server 1
@@ -644,15 +641,13 @@ public class DurableClientTestCase extends DurableClientTestBase {
       this.checkListenerEvents(2, 1, -1, this.durableClientVM);
     }
 
-    this.durableClientVM.invoke(new CacheSerializableRunnable("Get") {
-      @Override
-      public void run2() throws CacheException {
-        Region<Object, Object> region = CacheServerTestUtil.getCache().getRegion(regionName);
+    this.durableClientVM.invoke("Get", () -> {
+      await().untilAsserted(() -> {
+        Region<Object, Object> region = getCache().getRegion(regionName);
         assertThat(region).isNotNull();
-
         // Register interest in all keys
         assertThat(region.getEntry("0")).isNull();
-      }
+      });
     });
 
     publishEntries(4, 1);