You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by bs...@apache.org on 2018/06/26 17:59:28 UTC

[geode] branch develop updated: GEODE-1655: CI Failure in AutoConnectionSourceDUnitTest.testClientMembershipListener

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

bschuchardt 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 af0ac3d  GEODE-1655: CI Failure in AutoConnectionSourceDUnitTest.testClientMembershipListener
af0ac3d is described below

commit af0ac3ddc9e4d9c325a9187e38b9335954075997
Author: Bruce Schuchardt <bs...@pivotal.io>
AuthorDate: Tue Jun 26 10:55:05 2018 -0700

    GEODE-1655: CI Failure in AutoConnectionSourceDUnitTest.testClientMembershipListener
    
    The waitForCrash(), waitForJoin(), waitForLeave() methods in this test were
    modified to use Awaitility.  When that was done they started throwing
    exceptions but the old versions of these methods didn't do that.  They allowed
    the caller to perform validation checks if there was a timeout.
    
    In the case of testClientMembershipListener this has caused the test to fail
    if a server's departure is interpreted as not being a "crash" but a "leave".
    The validation code allows for that but the altered waitForCrash() method
    does not.
    
    I've modified the tests to ignore Awaitility timeouts in these methods, which
    should make the test stop being flaky.
---
 .../internal/AutoConnectionSourceDUnitTest.java       | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceDUnitTest.java
index e9945b2..ff54514 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/client/internal/AutoConnectionSourceDUnitTest.java
@@ -29,6 +29,7 @@ import java.util.Iterator;
 import java.util.List;
 
 import org.awaitility.Awaitility;
+import org.awaitility.core.ConditionTimeoutException;
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -526,21 +527,33 @@ public class AutoConnectionSourceDUnitTest extends LocatorTestBase {
   private void waitForJoin(VM vm) {
     vm.invoke("wait for join", () -> {
       MyListener listener = (MyListener) remoteObjects.get(BRIDGE_LISTENER);
-      Awaitility.await().atMost(10, SECONDS).until(() -> listener.getJoins() > 0);
+      try {
+        Awaitility.await().atMost(10, SECONDS).until(() -> listener.getJoins() > 0);
+      } catch (ConditionTimeoutException e) {
+        // do nothing here - caller will perform validations
+      }
     });
   }
 
   private void waitForCrash(VM vm) {
     vm.invoke("wait for crash", () -> {
       MyListener listener = (MyListener) remoteObjects.get(BRIDGE_LISTENER);
-      Awaitility.await().atMost(10, SECONDS).until(() -> listener.getCrashes() > 0);
+      try {
+        Awaitility.await().atMost(10, SECONDS).until(() -> listener.getCrashes() > 0);
+      } catch (ConditionTimeoutException e) {
+        // do nothing here - caller will perform validations
+      }
     });
   }
 
   private void waitForDeparture(VM vm) {
     vm.invoke("wait for departure", () -> {
       MyListener listener = (MyListener) remoteObjects.get(BRIDGE_LISTENER);
-      Awaitility.await().atMost(10, SECONDS).until(() -> listener.getDepartures() > 0);
+      try {
+        Awaitility.await().atMost(10, SECONDS).until(() -> listener.getDepartures() > 0);
+      } catch (ConditionTimeoutException e) {
+        // do nothing here - caller will perform validations
+      }
     });
   }