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

bschuchardt pushed a commit to branch feature/GEODE-6369
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/GEODE-6369 by this 
push:
     new 2050ae9  fixing another unit test failure
2050ae9 is described below

commit 2050ae9e36d79719a5f599a930537a4114be316b
Author: Bruce Schuchardt <bschucha...@pivotal.io>
AuthorDate: Fri Feb 15 12:28:11 2019 -0800

    fixing another unit test failure
    
    LocatorDUnitTest had a failure caused by my having moved
    the point in time where a new member joins.  I think
    this was an error introduced by Hitesh when he implemented
    the dhalgo stuff.
---
 .../java/org/apache/geode/ClusterCommunicationsDUnitTest.java     | 3 ++-
 .../internal/membership/gms/membership/GMSJoinLeave.java          | 8 +++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git 
a/geode-core/src/distributedTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java
 
b/geode-core/src/distributedTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java
index b4d106e..c970f77 100644
--- 
a/geode-core/src/distributedTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java
+++ 
b/geode-core/src/distributedTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java
@@ -30,6 +30,7 @@ import static 
org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTOR
 import static 
org.apache.geode.distributed.ConfigurationProperties.USE_CLUSTER_CONFIGURATION;
 import static 
org.apache.geode.internal.DataSerializableFixedID.SERIAL_ACKED_MESSAGE;
 import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.getTimeout;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.DataInput;
@@ -216,7 +217,7 @@ public class ClusterCommunicationsDUnitTest implements 
java.io.Serializable {
       // System.setProperty("javax.net.debug", "all");
       Properties props = getDistributedSystemProperties();
       // locator must restart with the same port so that it reconnects to the 
server
-      await().atMost(15, TimeUnit.SECONDS)
+      await().atMost(getTimeout().getValueInMS(), TimeUnit.MILLISECONDS)
           .until(() -> Locator.startLocatorAndDS(locatorPort, new File(""), 
props) != null);
       
assertThat(Locator.getLocator().getDistributedSystem().getAllOtherMembers().size())
           .isGreaterThan(0);
diff --git 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
index 50fb428..261bb70 100644
--- 
a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
+++ 
b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
@@ -460,8 +460,7 @@ public class GMSJoinLeave implements JoinLeave, 
MessageHandler {
       throw new GemFireSecurityException(failReason);
     }
 
-    // there is no way we can rech here right now
-    throw new RuntimeException("Join Request Failed with response " + 
joinResponse[0]);
+    throw new RuntimeException("Join Request Failed with response " + 
response);
   }
 
   private JoinResponseMessage waitForJoinResponse() throws 
InterruptedException {
@@ -1364,9 +1363,12 @@ public class GMSJoinLeave implements JoinLeave, 
MessageHandler {
         // 2. Member which was coordinator but just now some other member 
became coordinator
         // 3. we got message with secret key, but still view is coming and 
that will inform the
         // joining thread
-        if (rsp.getRejectionMessage() != null || rsp.getCurrentView() != null) 
{
+        if (rsp.getRejectionMessage() != null) {
           joinResponse[0] = rsp;
           joinResponse.notifyAll();
+        } else if (rsp.getCurrentView() != null) {
+          // ignore - we get to join when we receive a view. Joining earlier 
may
+          // confuse other members if we've reused an old address
         } else {
           // we got secret key lets add it
           services.getMessenger().setClusterSecretKey(rsp.getSecretPk());

Reply via email to