geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject [geode] branch develop updated: GEODE-5394: Change to add additional logging in the event of a failure.
Date Thu, 12 Jul 2018 22:24:10 GMT
This is an automated email from the ASF dual-hosted git repository.

upthewaterspout 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 5da7ad4  GEODE-5394: Change to add additional logging in the event of a failure.
5da7ad4 is described below

commit 5da7ad4a399135a0910e130f6d202acf0d7a5197
Author: Mark Hanson <mhanson@pivotal.io>
AuthorDate: Tue Jul 10 10:22:34 2018 -0700

    GEODE-5394: Change to add additional logging in the event of a failure.
    
    Co-authored-by: Jinmei Liao <jiliao@pivotal.io>
---
 .../tier/sockets/ClientServerMiscDUnitTest.java    | 76 +++++++---------------
 1 file changed, 23 insertions(+), 53 deletions(-)

diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java
index db30bb0..86d83ac 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java
@@ -71,6 +71,7 @@ import org.apache.geode.distributed.DistributedSystemDisconnectedException;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.internal.AvailablePort;
+import org.apache.geode.internal.OSProcess;
 import org.apache.geode.internal.cache.CacheServerImpl;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.LocalRegion;
@@ -489,7 +490,7 @@ public class ClientServerMiscDUnitTest extends JUnit4CacheTestCase {
     populateCache();
     registerInterestInBothTheRegions();
     closeBothRegions();
-    // pause(5000);
+
     assertEquals(false, pool.isDestroyed());
     pool.destroy();
     assertEquals(true, pool.isDestroyed());
@@ -880,31 +881,18 @@ public class ClientServerMiscDUnitTest extends JUnit4CacheTestCase {
     assertNotNull(region2);
     assertNotNull(prRegion);
     pool = p;
-    // conn = pool.acquireConnection();
-    // assertNotNull(conn);
-    // TODO does this WaitCriterion actually help?
-    WaitCriterion wc = new WaitCriterion() {
-      String excuse;
 
-      public boolean done() {
-        try {
-          conn = pool.acquireConnection();
-          if (conn == null) {
-            excuse = "acquireConnection returned null?";
-            return false;
-          }
-          return true;
-        } catch (NoAvailableServersException e) {
-          excuse = "Cannot find a server: " + e;
+    Awaitility.await().atMost(60, TimeUnit.SECONDS).pollInterval(1, TimeUnit.SECONDS).until(()
-> {
+      try {
+        conn = pool.acquireConnection();
+        if (conn == null) {
           return false;
         }
+        return true;
+      } catch (NoAvailableServersException e) {
+        return false;
       }
-
-      public String description() {
-        return excuse;
-      }
-    };
-    Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
+    });
 
     return p;
   }
@@ -1034,8 +1022,8 @@ public class ClientServerMiscDUnitTest extends JUnit4CacheTestCase {
       assertNotNull(r1);
       Region r2 = cache.getRegion(Region.SEPARATOR + REGION_NAME2);
       assertNotNull(r2);
-      r1.registerInterest("ALL_KEYS");
-      r2.registerInterest("ALL_KEYS");
+      r1.registerInterestForAllKeys();
+      r2.registerInterestForAllKeys();
     } catch (CacheWriterException e) {
       e.printStackTrace();
       Assert.fail("Test failed due to CacheWriterException during registerInterestnBothRegions",
e);
@@ -1138,27 +1126,18 @@ public class ClientServerMiscDUnitTest extends JUnit4CacheTestCase
{
     try {
       Cache cache = new ClientServerMiscDUnitTest().getCache();
       assertEquals("More than one BridgeServer", 1, cache.getCacheServers().size());
-      CacheServerImpl bs = (CacheServerImpl) cache.getCacheServers().iterator().next();
-      assertNotNull(bs);
-      assertNotNull(bs.getAcceptor());
-      final CacheClientNotifier ccn = bs.getAcceptor().getCacheClientNotifier();
+      CacheServerImpl cacheServer = (CacheServerImpl) cache.getCacheServers().iterator().next();
+      assertNotNull(cacheServer);
+      assertNotNull(cacheServer.getAcceptor());
+      final CacheClientNotifier ccn = cacheServer.getAcceptor().getCacheClientNotifier();
 
       assertNotNull(ccn);
-      WaitCriterion wc = new WaitCriterion() {
-        String excuse;
-
-        public boolean done() {
-          return ccn.getClientProxies().size() == 0;
-        }
-
-        public String description() {
-          return excuse;
-        }
-      };
-      Wait.waitForCriterion(wc, 40 * 1000, 1000, true);
+      Awaitility.await().atMost(40, TimeUnit.SECONDS).pollInterval(1, TimeUnit.SECONDS)
+          .until(() -> ccn.getClientProxies().size() == 0);
     } catch (Exception ex) {
-      ex.printStackTrace();
-      fail("while setting verifyNoCacheClientProxyOnServer  " + ex);
+      System.out.println("The size of the client proxies != 0");
+      OSProcess.printStacks(0);
+      throw ex;
     }
   }
 
@@ -1185,18 +1164,9 @@ public class ClientServerMiscDUnitTest extends JUnit4CacheTestCase
{
     final CacheClientNotifier ccn = bs.getAcceptor().getCacheClientNotifier();
 
     assertNotNull(ccn);
-    WaitCriterion wc = new WaitCriterion() {
-      String excuse;
-
-      public boolean done() {
-        return ccn.getClientProxies().size() == 1;
-      }
 
-      public String description() {
-        return excuse;
-      }
-    };
-    Wait.waitForCriterion(wc, 40 * 1000, 1000, true);
+    Awaitility.await().atMost(40, TimeUnit.SECONDS).pollInterval(1, TimeUnit.SECONDS)
+        .until(() -> ccn.getClientProxies().size() == 1);
   }
 
   public static void populateCache() {


Mime
View raw message