You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by je...@apache.org on 2018/03/22 18:54:41 UTC

[geode] branch develop updated: GEODE-4915: Fix ClusterConfigLocatorRestartDUnitTest intermittent failures (#1664)

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

jensdeppe 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 7c86962  GEODE-4915: Fix ClusterConfigLocatorRestartDUnitTest intermittent failures (#1664)
7c86962 is described below

commit 7c86962667f834145e31f5f52b9b0962cef96123
Author: Jens Deppe <jd...@pivotal.io>
AuthorDate: Thu Mar 22 11:54:37 2018 -0700

    GEODE-4915: Fix ClusterConfigLocatorRestartDUnitTest intermittent failures (#1664)
    
    - Use Awaitility to poll for expected results.
---
 .../ClusterConfigLocatorRestartDUnitTest.java         | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigLocatorRestartDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigLocatorRestartDUnitTest.java
index 933da25..ae67f24 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigLocatorRestartDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigLocatorRestartDUnitTest.java
@@ -29,6 +29,7 @@ import org.apache.geode.distributed.internal.InternalLocator;
 import org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper;
 import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.IgnoredException;
+import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.rules.ClusterStartupRule;
 import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.junit.categories.DistributedTest;
@@ -62,8 +63,10 @@ public class ClusterConfigLocatorRestartDUnitTest {
     rule.startServerVM(3, locator0.getPort());
 
     gfsh.connectAndVerify(locator0);
-    gfsh.executeAndAssertThat("list members").statusIsSuccess().tableHasColumnOnlyWithValues("Name",
-        "locator-0", "server-1", "server-2", "server-3");
+
+    Awaitility.await().atMost(10, TimeUnit.SECONDS)
+        .until(() -> gfsh.executeAndAssertThat("list members").statusIsSuccess()
+            .tableHasColumnOnlyWithValues("Name", "locator-0", "server-1", "server-2", "server-3"));
   }
 
   @Test
@@ -86,9 +89,12 @@ public class ClusterConfigLocatorRestartDUnitTest {
     MemberVM server2 = rule.startServerVM(2, props, locator0.getPort(), locator1.getPort());
     MemberVM server3 = rule.startServerVM(3, props, locator0.getPort(), locator1.getPort());
 
-    // Go away and don't come back
+    // Shut down hard
     locator0.invokeAsync(() -> System.exit(1));
 
+    // Recover the VM so that subsequent rule cleanup works
+    locator0.getVM().bounce();
+
     server3.invokeAsync(() -> MembershipManagerHelper
         .crashDistributedSystem(InternalDistributedSystem.getConnectedInstance()));
 
@@ -97,11 +103,10 @@ public class ClusterConfigLocatorRestartDUnitTest {
     rule.startServerVM(4, locator1.getPort(), locator0.getPort());
 
     gfsh.connectAndVerify(locator1);
-    gfsh.executeAndAssertThat("list members").statusIsSuccess().tableHasColumnOnlyWithValues("Name",
-        "locator-1", "server-2", "server-3", "server-4");
 
-    // Recover the VM so that subsequent rule cleanup works
-    Host.getHost(0).getVM(0).bounce();
+    Awaitility.await().atMost(10, TimeUnit.SECONDS)
+        .until(() -> gfsh.executeAndAssertThat("list members").statusIsSuccess()
+            .tableHasColumnOnlyWithValues("Name", "locator-1", "server-2", "server-3", "server-4"));
   }
 
   private void waitForLocatorToReconnect(MemberVM locator) {

-- 
To stop receiving notification emails like this one, please contact
jensdeppe@apache.org.