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

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

commit aba29fb7dd236ecd8f784672c50236d7983332a0
Author: Bruce Schuchardt <[email protected]>
AuthorDate: Tue Jun 2 07:51:39 2020 -0700

    GEODE-8206: CI Failure: 
ReconnectWithClusterConfigurationDUnitTest.testReconnectAfterMeltdown hang 
(#5192)
    
    Modified the test to set the correct locator ports.
    
    Modified the teardown code to tell the cache to stop
    reconnecting.
    
    Modified each run to use a temporary working directory so that runs
    don't leave behind artifacts on disk that can taint subsequent runs.
    
    (cherry picked from commit 426d7fd41d0d66a7557f86236d6773f582e7ef0a)
---
 ...ReconnectWithClusterConfigurationDUnitTest.java | 23 +++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git 
a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java
 
b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java
index d6925d1..32edbc5 100644
--- 
a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java
+++ 
b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java
@@ -31,6 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import java.io.File;
 import java.io.IOException;
 import java.io.Serializable;
+import java.net.UnknownHostException;
 import java.nio.file.Paths;
 import java.util.List;
 import java.util.Properties;
@@ -46,7 +47,6 @@ import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.distributed.Locator;
-import 
org.apache.geode.distributed.internal.InternalConfigurationPersistenceService;
 import org.apache.geode.distributed.internal.InternalLocator;
 import 
org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper;
 import org.apache.geode.distributed.internal.tcpserver.HostAddress;
@@ -72,7 +72,9 @@ public class ReconnectWithClusterConfigurationDUnitTest 
implements Serializable
   static Properties dsProperties;
 
   @Rule
-  public DistributedRule distributedRule = 
DistributedRule.builder().withVMCount(NUM_VMS).build();
+  public transient DistributedRule distributedRule =
+      DistributedRule.builder().withVMCount(NUM_VMS).build();
+
   @Rule
   public transient TemporaryFolder temporaryFolder = new TemporaryFolder();
 
@@ -96,7 +98,7 @@ public class ReconnectWithClusterConfigurationDUnitTest 
implements Serializable
           dsProperties = null;
           Properties props = getDistributedSystemProperties();
           locator = InternalLocator.startLocator(locatorPorts[locatorNumber], 
new File(""),
-              null, null, new HostAddress(LocalHostUtil.getLocalHost()), true,
+              null, null, LocalHostUtil.getLocalHost(), true,
               props, null, Paths.get(workingDir));
           system = locator.getDistributedSystem();
           cache = ((InternalLocator) locator).getCache();
@@ -115,10 +117,8 @@ public class ReconnectWithClusterConfigurationDUnitTest 
implements Serializable
       VM.getVM(i).invoke(() -> {
         InternalLocator locator = InternalLocator.getLocator();
         if (locator != null) {
-          InternalConfigurationPersistenceService sharedConfig =
-              locator.getConfigurationPersistenceService();
-          if (sharedConfig != null) {
-            sharedConfig.destroySharedConfiguration();
+          if (cache != null && cache.isReconnecting()) {
+            cache.stopReconnecting();
           }
           locator.stop();
         }
@@ -133,7 +133,7 @@ public class ReconnectWithClusterConfigurationDUnitTest 
implements Serializable
     });
   }
 
-  public Properties getDistributedSystemProperties() {
+  public Properties getDistributedSystemProperties() throws 
UnknownHostException {
     dsProperties = new Properties();
     dsProperties.put(MAX_WAIT_TIME_RECONNECT, "" + (5000 * NUM_VMS));
     dsProperties.put(ENABLE_NETWORK_PARTITION_DETECTION, "true");
@@ -142,12 +142,13 @@ public class ReconnectWithClusterConfigurationDUnitTest 
implements Serializable
     dsProperties.put(USE_CLUSTER_CONFIGURATION, "true");
     dsProperties.put(HTTP_SERVICE_PORT, "0");
     StringBuilder stringBuilder = new StringBuilder();
-    stringBuilder.append("localHost[")
+    final String localHostName = LocalHostUtil.getLocalHostName();
+    stringBuilder.append(localHostName + "[")
         .append(locatorPorts[0])
         .append(']');
     for (int i = 1; i < NUM_LOCATORS; i++) {
-      stringBuilder.append(",localHost[")
-          .append(locatorPorts[0])
+      stringBuilder.append("," + localHostName + "[")
+          .append(locatorPorts[i])
           .append(']');
     }
     dsProperties.put(LOCATORS, stringBuilder.toString());

Reply via email to