geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject [1/2] incubator-geode git commit: GEODE-77 fixes for failing unit and integration tests
Date Thu, 24 Sep 2015 22:55:12 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-77 99e50c12a -> eab327f6a


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messages/LeaveRequestMessage.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messages/LeaveRequestMessage.java b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messages/LeaveRequestMessage.java
index df91a64..19eca77 100755
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messages/LeaveRequestMessage.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messages/LeaveRequestMessage.java
@@ -11,7 +11,8 @@ import com.gemstone.gemfire.distributed.internal.HighPriorityDistributionMessage
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.internal.Version;
 
-public class LeaveRequestMessage extends HighPriorityDistributionMessage {
+public class LeaveRequestMessage extends HighPriorityDistributionMessage
+  implements HasMemberID {
   private InternalDistributedMember memberID;
   private String reason;
   

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messages/PingRequestMessage.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messages/PingRequestMessage.java b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messages/PingRequestMessage.java
deleted file mode 100755
index a38c586..0000000
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messages/PingRequestMessage.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package com.gemstone.gemfire.distributed.internal.membership.gms.messages;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-
-import com.gemstone.gemfire.DataSerializer;
-import com.gemstone.gemfire.distributed.internal.DistributionManager;
-import com.gemstone.gemfire.distributed.internal.HighPriorityDistributionMessage;
-import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
-import com.gemstone.gemfire.internal.Version;
-
-public class PingRequestMessage extends HighPriorityDistributionMessage{
-
-  int requestId;
-  InternalDistributedMember target;
-  
-  public PingRequestMessage(InternalDistributedMember neighbour, int id) {
-    requestId = id;
-    this.target = neighbour;
-  }
-  
-  public PingRequestMessage(){}
-  
-  public InternalDistributedMember getTarget() {
-    return target;
-  }
-  
-  @Override
-  public int getDSFID() {
-    return PING_REQUEST;
-  }
-
-  @Override
-  protected void process(DistributionManager dm) {
-    throw new IllegalStateException("this message is not intended to execute in a thread pool");
-  }   
-
-  @Override
-  public String toString() {
-    return "PingRequestMessage [requestId=" + requestId + "] from " + getSender();
-  }
-
-  public int getRequestId() {
-    return requestId;
-  }
-
-  @Override
-  public Version[] getSerializationVersions() {
-    return null;
-  }  
-  
-  @Override
-  public void toData(DataOutput out) throws IOException {
-    out.writeInt(requestId);
-    DataSerializer.writeObject(target, out);
-  }
-  
-  @Override
-  public void fromData(DataInput in) throws IOException, ClassNotFoundException {
-    requestId = in.readInt();
-    target = DataSerializer.readObject(in);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messages/PingResponseMessage.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messages/PingResponseMessage.java b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messages/PingResponseMessage.java
deleted file mode 100755
index ef69e25..0000000
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messages/PingResponseMessage.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.gemstone.gemfire.distributed.internal.membership.gms.messages;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-
-import com.gemstone.gemfire.distributed.internal.DistributionManager;
-import com.gemstone.gemfire.distributed.internal.HighPriorityDistributionMessage;
-import com.gemstone.gemfire.internal.Version;
-
-public class PingResponseMessage extends HighPriorityDistributionMessage {
-  int requestId;
-  
-  public PingResponseMessage(int id) {
-    requestId = id;
-  }
-
-  public PingResponseMessage(){}
-  
-  public int getRequestId() {
-    return requestId;
-  }
-
-
-  @Override
-  public int getDSFID() {
-    return PING_RESPONSE;
-  }
-
-  @Override
-  protected void process(DistributionManager dm) {
-    throw new IllegalStateException("this message is not intended to execute in a thread pool");
-  }
- 
-  @Override
-  public String toString() {
-    return "PingResponseMessage [requestId=" + requestId + "] from " + getSender();
-  }
-
-  @Override
-  public Version[] getSerializationVersions() {
-    return null;
-  }  
-
-  @Override
-  public void toData(DataOutput out) throws IOException {
-    out.writeInt(requestId);
-  }
-  
-  @Override
-  public void fromData(DataInput in) throws IOException, ClassNotFoundException {
-    requestId = in.readInt();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messages/RemoveMemberMessage.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messages/RemoveMemberMessage.java b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messages/RemoveMemberMessage.java
index 30137a2..07da022 100755
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messages/RemoveMemberMessage.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messages/RemoveMemberMessage.java
@@ -12,7 +12,8 @@ import com.gemstone.gemfire.distributed.internal.HighPriorityDistributionMessage
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.internal.Version;
 
-public class RemoveMemberMessage extends HighPriorityDistributionMessage {
+public class RemoveMemberMessage extends HighPriorityDistributionMessage
+  implements HasMemberID {
   private InternalDistributedMember memberID;
   private String reason;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/JGroupsMessenger.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/JGroupsMessenger.java b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/JGroupsMessenger.java
index c7c6a19..c1acb87 100755
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/JGroupsMessenger.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/JGroupsMessenger.java
@@ -270,6 +270,7 @@ public class JGroupsMessenger implements Messenger {
         myChannel.connect("AG"); // apache g***** (whatever we end up calling it)
       }
     } catch (Exception e) {
+      myChannel.close();
       throw new SystemConnectException("unable to create jgroups channel", e);
     }
     
@@ -568,6 +569,7 @@ public class JGroupsMessenger implements Messenger {
       for (int i = 0; i < destinations.length; i ++) {
         InternalDistributedMember d = destinations[i];
         if (!newView.contains(d)) {
+          logger.debug("messenger: member has left the view: {}", d);
           result.add(d);
         }
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManager.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManager.java b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManager.java
index b873154..64dd1cd 100755
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManager.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManager.java
@@ -1191,7 +1191,7 @@ public class GMSMembershipManager implements MembershipManager, Manager
 
   /** starts periodic task to perform cleanup chores such as expire surprise members */
   private void startCleanupTimer() {
-    latestViewLock.readLock().lock();
+    latestViewLock.writeLock().lock();
     try {
       if (this.cleanupTimer != null) {
         return;
@@ -1225,7 +1225,7 @@ public class GMSMembershipManager implements MembershipManager, Manager
         this.cleanupTimer.scheduleAtFixedRate(st, surpriseMemberTimeout, surpriseMemberTimeout/3);
       } // ds != null && ds.isConnected()
     } finally {
-      latestViewLock.readLock().unlock();
+      latestViewLock.writeLock().unlock();
     }
   }
   /**
@@ -1274,7 +1274,7 @@ public class GMSMembershipManager implements MembershipManager, Manager
     boolean shunned = false;
 
     // First grab the lock: check the sender against our stabilized view.
-    latestViewLock.readLock().lock();
+    latestViewLock.writeLock().lock();
     try {
       if (isShunned(m)) {
         if (msg instanceof StartupMessage) {
@@ -1298,7 +1298,7 @@ public class GMSMembershipManager implements MembershipManager, Manager
 
       // Latch the view before we unlock
     } finally {
-      latestViewLock.readLock().unlock();
+      latestViewLock.writeLock().unlock();
     }
     
     if (shunned) { // bug #41538 - shun notification must be outside synchronization to avoid hanging
@@ -1324,7 +1324,7 @@ public class GMSMembershipManager implements MembershipManager, Manager
         return;
       }
     }
-    latestViewLock.readLock().lock();
+    latestViewLock.writeLock().lock();
     try {
       synchronized(startupLock) {
         if (!processingEvents) {
@@ -1345,7 +1345,7 @@ public class GMSMembershipManager implements MembershipManager, Manager
 
       listener.messageReceived(v);
     } finally {
-      latestViewLock.readLock().unlock();
+      latestViewLock.writeLock().unlock();
     }
   }
   
@@ -1395,12 +1395,7 @@ public class GMSMembershipManager implements MembershipManager, Manager
       InternalDistributedMember member, 
       Stub stub) 
   {
-    latestViewLock.writeLock().lock();
-    try {
-      addSurpriseMember(member, stub);
-    } finally {
-      latestViewLock.writeLock().unlock();
-    }
+    addSurpriseMember(member, stub);
   }
   
   /**
@@ -1916,11 +1911,14 @@ public class GMSMembershipManager implements MembershipManager, Manager
     InternalDistributedMember[] keys;
     if (content.forAll()) {
       allDestinations = true;
-      latestViewLock.readLock().lock();
-      Set keySet = memberToStubMap.keySet();
-      keys = new InternalDistributedMember[keySet.size()];
-      keys = (InternalDistributedMember[])keySet.toArray(keys);
-      latestViewLock.readLock().unlock();
+      latestViewLock.writeLock().lock();
+      try {
+        Set keySet = memberToStubMap.keySet();
+        keys = new InternalDistributedMember[keySet.size()];
+        keys = (InternalDistributedMember[])keySet.toArray(keys);
+      } finally {
+        latestViewLock.writeLock().unlock();
+      }
     }
     else {
       allDestinations = false;
@@ -2149,7 +2147,7 @@ public class GMSMembershipManager implements MembershipManager, Manager
     if (result != null)
       return result;
 
-    latestViewLock.readLock().lock();
+    latestViewLock.writeLock().lock();
     try {
       // Do all of this work in a critical region to prevent
       // members from slipping in during shutdown
@@ -2162,14 +2160,14 @@ public class GMSMembershipManager implements MembershipManager, Manager
       result = directChannel.createConduitStub(m);
       addChannel(m, result);
     } finally {
-      latestViewLock.readLock().unlock();
+      latestViewLock.writeLock().unlock();
     }
    return result;
   }
 
   public InternalDistributedMember getMemberForStub(Stub s, boolean validated)
   {
-    latestViewLock.readLock().lock();
+    latestViewLock.writeLock().lock();
     try {
       if (shutdownInProgress) {
         throw new DistributedSystemDisconnectedException(LocalizedStrings.GroupMembershipService_DISTRIBUTEDSYSTEM_IS_SHUTTING_DOWN.toLocalizedString(), services.getShutdownCause());
@@ -2200,31 +2198,15 @@ public class GMSMembershipManager implements MembershipManager, Manager
       }
       return result;
     } finally {
-      latestViewLock.readLock().unlock();
+      latestViewLock.writeLock().unlock();
     }
   }
 
-  /**
-   * return the member address for the given GMS address, or null if it's not a member
-   */
-  public InternalDistributedMember getMemberForAddress(InetSocketAddress addr) {
-    latestViewLock.readLock().lock();
-    try {
-      for (InternalDistributedMember idm: latestView.getMembers()) {
-        if (idm.getInetAddress().equals(addr.getAddress())
-              && idm.getPort() == addr.getPort()) {
-            return idm;
-        }
-      }
-      return null;
-    } finally {
-      latestViewLock.readLock().unlock();
-    }
-  }
-  
   public void setShutdown()
   {
+    latestViewLock.writeLock().lock();
     shutdownInProgress = true;
+    latestViewLock.writeLock().unlock();
   }
 
   @Override
@@ -2330,8 +2312,11 @@ public class GMSMembershipManager implements MembershipManager, Manager
   {
     Stub result;
     latestViewLock.readLock().lock();
-    result = (Stub)memberToStubMap.get(address);
-    latestViewLock.readLock().unlock();
+    try {
+      result = (Stub)memberToStubMap.get(address);
+    } finally {
+      latestViewLock.readLock().unlock();
+    }
     return result;
   }
 
@@ -2347,7 +2332,7 @@ public class GMSMembershipManager implements MembershipManager, Manager
    * @return true if the given member is a zombie
    */
   public boolean isShunned(DistributedMember m) {
-    latestViewLock.readLock().lock();
+    latestViewLock.writeLock().lock();
     try {
       if (!shunnedMembers.containsKey(m))
         return false;
@@ -2365,7 +2350,7 @@ public class GMSMembershipManager implements MembershipManager, Manager
       endShun(m);
       return false;
     } finally {
-      latestViewLock.readLock().unlock();
+      latestViewLock.writeLock().unlock();
     }
   }
 
@@ -2530,11 +2515,11 @@ public class GMSMembershipManager implements MembershipManager, Manager
     if (Thread.interrupted()) throw new InterruptedException();
     DirectChannel dc = directChannel;
     Stub stub;
-    latestViewLock.readLock().lock();
+    latestViewLock.writeLock().lock();
     try {
       stub = (Stub)memberToStubMap.get(otherMember);
     } finally {
-      latestViewLock.readLock().unlock();
+      latestViewLock.writeLock().unlock();
     }
     if (dc != null && stub != null) {
       dc.waitForChannelState(stub, channelState);
@@ -2576,8 +2561,11 @@ public class GMSMembershipManager implements MembershipManager, Manager
       }
       if (!wait) {
         latestViewLock.readLock().lock();
-        wait = this.latestView.contains(idm);
-        latestViewLock.readLock().unlock();
+        try {
+          wait = this.latestView.contains(idm);
+        } finally {
+          latestViewLock.readLock().unlock();
+        }
         if (wait && logger.isDebugEnabled()) {
           logger.debug("waiting for {} to leave the membership view", mbr);
         }
@@ -2627,7 +2615,7 @@ public class GMSMembershipManager implements MembershipManager, Manager
     CountDownLatch currentLatch = null;
     // ARB: preconditions
     // remoteId != null
-    latestViewLock.readLock().lock();
+    latestViewLock.writeLock().lock();
     try {
       if (latestView == null) {
         // Not sure how this would happen, but see bug 38460.
@@ -2643,7 +2631,7 @@ public class GMSMembershipManager implements MembershipManager, Manager
         this.memberLatch.put(remoteId, currentLatch);
       }
     } finally {
-      latestViewLock.readLock().unlock();
+      latestViewLock.writeLock().unlock();
     }
 
     if (!foundRemoteId) {
@@ -2700,7 +2688,7 @@ public class GMSMembershipManager implements MembershipManager, Manager
   
   public void registerTestHook(MembershipTestHook mth) {
     // lock for additions to avoid races during startup
-    latestViewLock.readLock().lock();
+    latestViewLock.writeLock().lock();
     try {
       if (this.membershipTestHooks == null) {
         this.membershipTestHooks = Collections.singletonList(mth);
@@ -2711,12 +2699,12 @@ public class GMSMembershipManager implements MembershipManager, Manager
         this.membershipTestHooks = l;
       }
     } finally {
-      latestViewLock.readLock().unlock();
+      latestViewLock.writeLock().unlock();
     }
   }
   
   public void unregisterTestHook(MembershipTestHook mth) {
-    latestViewLock.readLock().lock();
+    latestViewLock.writeLock().lock();
     try {
       if (this.membershipTestHooks != null) {
         if (this.membershipTestHooks.size() == 1) {
@@ -2728,7 +2716,7 @@ public class GMSMembershipManager implements MembershipManager, Manager
         }
       }
     } finally {
-      latestViewLock.readLock().unlock();
+      latestViewLock.writeLock().unlock();
     }
   }
   
@@ -2741,8 +2729,8 @@ public class GMSMembershipManager implements MembershipManager, Manager
   public synchronized void beSick() {
     if (!beingSick) {
       beingSick = true;
-      if (logger.isDebugEnabled()) {
-        logger.debug("GroupMembershipService.beSick invoked for {} - simulating sickness", this.address);
+      if (logger.isInfoEnabled()) {
+        logger.info("GroupMembershipService.beSick invoked for {} - simulating sickness", this.address);
       }
       services.getJoinLeave().beSick();
       services.getHealthMonitor().beSick();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/main/java/com/gemstone/gemfire/internal/DSFIDFactory.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/DSFIDFactory.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/DSFIDFactory.java
index 663f495..a743c8a 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/DSFIDFactory.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/DSFIDFactory.java
@@ -99,8 +99,8 @@ import com.gemstone.gemfire.distributed.internal.membership.gms.messages.Install
 import com.gemstone.gemfire.distributed.internal.membership.gms.messages.JoinRequestMessage;
 import com.gemstone.gemfire.distributed.internal.membership.gms.messages.JoinResponseMessage;
 import com.gemstone.gemfire.distributed.internal.membership.gms.messages.LeaveRequestMessage;
-import com.gemstone.gemfire.distributed.internal.membership.gms.messages.PingRequestMessage;
-import com.gemstone.gemfire.distributed.internal.membership.gms.messages.PingResponseMessage;
+import com.gemstone.gemfire.distributed.internal.membership.gms.messages.CheckRequestMessage;
+import com.gemstone.gemfire.distributed.internal.membership.gms.messages.CheckResponseMessage;
 import com.gemstone.gemfire.distributed.internal.membership.gms.messages.RemoveMemberMessage;
 import com.gemstone.gemfire.distributed.internal.membership.gms.messages.SuspectMembersMessage;
 import com.gemstone.gemfire.distributed.internal.membership.gms.messages.ViewAckMessage;
@@ -474,8 +474,8 @@ public final class DSFIDFactory implements DataSerializableFixedID {
 
   private static void registerDSFIDTypes() {
     registerDSFID(REMOVE_MEMBER_REQUEST, RemoveMemberMessage.class);
-    registerDSFID(PING_REQUEST, PingRequestMessage.class);
-    registerDSFID(PING_RESPONSE, PingResponseMessage.class);
+    registerDSFID(CHECK_REQUEST, CheckRequestMessage.class);
+    registerDSFID(CHECK_RESPONSE, CheckResponseMessage.class);
     registerDSFID(SUSPECT_MEMBERS_MESSAGE, SuspectMembersMessage.class);
     registerDSFID(LEAVE_REQUEST_MESSAGE, LeaveRequestMessage.class);
     registerDSFID(VIEW_ACK_MESSAGE, ViewAckMessage.class);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/main/java/com/gemstone/gemfire/internal/DataSerializableFixedID.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/DataSerializableFixedID.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/DataSerializableFixedID.java
index 12141e0..39fdeef 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/DataSerializableFixedID.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/DataSerializableFixedID.java
@@ -77,8 +77,8 @@ public interface DataSerializableFixedID extends SerializationVersions {
   
   public static final short SUSPECT_MEMBERS_MESSAGE = -156;
   
-  public static final short PING_RESPONSE = -155;
-  public static final short PING_REQUEST = -154;
+  public static final short CHECK_RESPONSE = -155;
+  public static final short CHECK_REQUEST = -154;
   public static final short REMOVE_MEMBER_REQUEST = -153;
   
   public static final short LEAVE_REQUEST_MESSAGE = -152;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/PRTombstoneMessage.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/PRTombstoneMessage.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/PRTombstoneMessage.java
index 92d7f4d..98cf85d 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/PRTombstoneMessage.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/PRTombstoneMessage.java
@@ -74,7 +74,8 @@ public final class PRTombstoneMessage extends PartitionMessageWithDirectReply
     try {
       p.waitForCacheException();
     } catch (ForceReattemptException e) {
-      throw new InternalGemFireError("unexpected ForceReattemptException", e);
+      // ignore - the member is going away or has destroyed the PR so
+      // it won't be forwarding anything to clients for the PR
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientNotifier.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientNotifier.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientNotifier.java
index 2cede25..cf0619d 100755
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientNotifier.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientNotifier.java
@@ -76,6 +76,8 @@ import com.gemstone.gemfire.internal.InternalInstantiator;
 import com.gemstone.gemfire.internal.SocketUtils;
 import com.gemstone.gemfire.internal.SystemTimer;
 import com.gemstone.gemfire.internal.Version;
+import com.gemstone.gemfire.internal.VersionedDataInputStream;
+import com.gemstone.gemfire.internal.VersionedDataOutputStream;
 import com.gemstone.gemfire.internal.cache.BridgeObserver;
 import com.gemstone.gemfire.internal.cache.BridgeObserverHolder;
 import com.gemstone.gemfire.internal.cache.BridgeRegionEventImpl;
@@ -326,7 +328,11 @@ public class CacheClientNotifier {
     dis.readByte(); // replyCode
 
     if (Version.GFE_57.compareTo(clientVersion) <= 0) {
-        registerGFEClient(dis, dos, socket, isPrimary, startTime, clientVersion,
+      if (Version.CURRENT.compareTo(clientVersion) > 0) {
+        dis = new VersionedDataInputStream(dis, clientVersion);
+        dos = new VersionedDataOutputStream(dos, clientVersion);
+      }
+      registerGFEClient(dis, dos, socket, isPrimary, startTime, clientVersion,
             acceptorId, notifyBySubscription);
     } else {
         Exception e = new UnsupportedVersionException(clientVersionOrdinal);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientProxyMembershipID.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientProxyMembershipID.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientProxyMembershipID.java
index e131464..6b20fab 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientProxyMembershipID.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/ClientProxyMembershipID.java
@@ -339,6 +339,10 @@ public final class ClientProxyMembershipID
 //          "serializing a client ID with zero port: " + this.toString(),
 //          new Exception("Stack trace"));
 //    }
+    Version v = InternalDataSerializer.getVersionForDataStream(out);
+    if (v.compareTo(Version.GFE_90) >= 0) {
+      Version.CURRENT.writeOrdinal(out, true);
+    }
     DataSerializer.writeByteArray(this.identity, out);
     out.writeInt(this.uniqueId);
   }
@@ -346,6 +350,11 @@ public final class ClientProxyMembershipID
   public void fromData(DataInput in) throws IOException, ClassNotFoundException
   {
     this.clientVersion = InternalDataSerializer.getVersionForDataStream(in);
+    // client IDs are not always carefully serialized/deserialized so they
+    // must know their own version
+    if (this.clientVersion.compareTo(Version.GFE_90) >= 0) {
+      this.clientVersion = Version.readVersion(in, false);
+    }
     this.identity = DataSerializer.readByteArray(in);
     this.uniqueId = in.readInt();
 //    {toString(); this.transientPort = ((InternalDistributedMember)this.memberId).getPort();}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/ServerConnection.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/ServerConnection.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/ServerConnection.java
index b307b95..dae1ae5 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/ServerConnection.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/ServerConnection.java
@@ -566,7 +566,7 @@ public class ServerConnection implements Runnable {
       }
 
       if (isDebugEnabled) {
-        logger.debug("{} registering client {}", (registerClient? "" : "not "), proxyId);
+        logger.debug("{}registering client {}", (registerClient? "" : "not "), proxyId);
       }
       this.crHelper.checkCancelInProgress(null);
       if (clientJoined && isFiringMembershipEvents()) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/LogFileParser.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/LogFileParser.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/LogFileParser.java
index 23209fa..fc10b92 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/LogFileParser.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/LogFileParser.java
@@ -149,6 +149,14 @@ public class LogFileParser  {
     int llen = line.length();
     String result = null;
     if (llen > 10) {
+      // first see if the start of the line is a timestamp, as in a thread-dump's stamp
+      if (line.charAt(0) == '2' &&
+          line.charAt(1) == '0' &&
+          line.charAt(4) == '-' &&
+          line.charAt(7) == '-') {
+        return line.substring(0, 19).replace('-', '/');
+      }
+      // now look for gemfire's log format
       if (line.charAt(0) == '[') {
         if ((line.charAt(1) == 'i' &&
              line.charAt(2) == 'n' &&

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCECompressionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCECompressionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCECompressionDUnitTest.java
deleted file mode 100644
index 0bffdef..0000000
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckOverflowRegionCCECompressionDUnitTest.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.cache30;
-
-import com.gemstone.gemfire.cache.AttributesFactory;
-import com.gemstone.gemfire.cache.RegionAttributes;
-import com.gemstone.gemfire.compression.Compressor;
-import com.gemstone.gemfire.compression.SnappyCompressor;
-
-/**
- * Tests Distributed Ack Overflow Region with ConcurrencyChecksEnabled and compression.
- * 
- * @author Kirk Lund
- * @since 8.0
- */
-public class DistributedAckOverflowRegionCCECompressionDUnitTest extends
-    DistributedAckOverflowRegionCCEDUnitTest {
-
-  public DistributedAckOverflowRegionCCECompressionDUnitTest(String name) {
-    super(name);
-  }
-
-  @SuppressWarnings({ "rawtypes", "unchecked" })
-  @Override
-  protected RegionAttributes getRegionAttributes() {
-    Compressor compressor = null;
-    try {
-      compressor = SnappyCompressor.getDefaultInstance();
-    } catch (Throwable t) {
-      // Not a supported OS
-      return super.getRegionAttributes();
-    }
-    RegionAttributes attrs = super.getRegionAttributes();
-    AttributesFactory factory = new AttributesFactory(attrs);
-    factory.setCompressor(compressor);
-    return factory.create();
-  }
-  
-  @SuppressWarnings({ "rawtypes", "unchecked" })
-  @Override
-  protected RegionAttributes getRegionAttributes(String type) {
-    Compressor compressor = null;
-    try {
-      compressor = SnappyCompressor.getDefaultInstance();
-    } catch (Throwable t) {
-      // Not a supported OS
-      return super.getRegionAttributes(type);
-    }
-    RegionAttributes ra = super.getRegionAttributes(type);
-    AttributesFactory factory = new AttributesFactory(ra);
-    if(!ra.getDataPolicy().isEmpty()) {
-      factory.setCompressor(compressor);
-    }
-    return factory.create();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCECompressionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCECompressionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCECompressionDUnitTest.java
deleted file mode 100644
index 7d7012a..0000000
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckPersistentRegionCCECompressionDUnitTest.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.cache30;
-
-import com.gemstone.gemfire.cache.AttributesFactory;
-import com.gemstone.gemfire.cache.RegionAttributes;
-import com.gemstone.gemfire.compression.Compressor;
-import com.gemstone.gemfire.compression.SnappyCompressor;
-
-/**
- * Tests Distributed Ack Persistent Region with ConcurrencyChecksEnabled and compression.
- * 
- * @author rholmes
- * @since 8.0
- */
-@SuppressWarnings({ "deprecation", "serial" })
-public class DistributedAckPersistentRegionCCECompressionDUnitTest extends
-    DistributedAckPersistentRegionCCEDUnitTest {
-  
-  public DistributedAckPersistentRegionCCECompressionDUnitTest(String name) {
-    super(name);
-  }
-
-  @SuppressWarnings({ "rawtypes", "unchecked" })
-  @Override
-  protected RegionAttributes getRegionAttributes() {
-    Compressor compressor = null;
-    try {
-      compressor = SnappyCompressor.getDefaultInstance();
-    } catch (Throwable t) {
-      // Not a supported OS
-      return super.getRegionAttributes();
-    }
-    RegionAttributes attrs = super.getRegionAttributes();
-    AttributesFactory factory = new AttributesFactory(attrs);
-    factory.setCompressor(compressor);
-    return factory.create();
-  }
-  
-  @SuppressWarnings({ "rawtypes", "unchecked" })
-  @Override
-  protected RegionAttributes getRegionAttributes(String type) {
-    Compressor compressor = null;
-    try {
-      compressor = SnappyCompressor.getDefaultInstance();
-    } catch (Throwable t) {
-      // Not a supported OS
-      return super.getRegionAttributes(type);
-    }
-    RegionAttributes ra = super.getRegionAttributes(type);
-    AttributesFactory factory = new AttributesFactory(ra);
-    if(!ra.getDataPolicy().isEmpty()) {
-      factory.setCompressor(compressor);
-    }
-    return factory.create();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCompressionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCompressionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCompressionDUnitTest.java
deleted file mode 100644
index ecf204f..0000000
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCompressionDUnitTest.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.cache30;
-
-import com.gemstone.gemfire.cache.AttributesFactory;
-import com.gemstone.gemfire.cache.RegionAttributes;
-import com.gemstone.gemfire.compression.Compressor;
-import com.gemstone.gemfire.compression.SnappyCompressor;
-
-/**
- * Tests Distributed NoAck Region with compression.
- * 
- * @author rholmes
- * @since 8.0
- */
-@SuppressWarnings({ "deprecation", "serial" })
-public class DistributedNoAckRegionCompressionDUnitTest extends
-    DistributedNoAckRegionDUnitTest {
-
-  public DistributedNoAckRegionCompressionDUnitTest(String name) {
-    super(name);
-  }
-  
-  @SuppressWarnings({ "rawtypes", "unchecked" })
-  @Override
-  protected RegionAttributes getRegionAttributes() {
-    Compressor compressor = null;
-    try {
-      compressor = SnappyCompressor.getDefaultInstance();
-    } catch (Throwable t) {
-      // Not a supported OS
-      return super.getRegionAttributes();
-    }
-    RegionAttributes attrs = super.getRegionAttributes();
-    AttributesFactory factory = new AttributesFactory(attrs);
-    factory.setCompressor(compressor);
-    return factory.create();
-  }
-  
-  @SuppressWarnings({ "rawtypes", "unchecked" })
-  @Override
-  protected RegionAttributes getRegionAttributes(String type) {
-    Compressor compressor = null;
-    try {
-      compressor = SnappyCompressor.getDefaultInstance();
-    } catch (Throwable t) {
-      // Not a supported OS
-      return super.getRegionAttributes(type);
-    }
-    RegionAttributes ra = super.getRegionAttributes(type);
-    AttributesFactory factory = new AttributesFactory(ra);
-    if(!ra.getDataPolicy().isEmpty()) {
-      factory.setCompressor(compressor);
-    }
-    return factory.create();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCompressionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCompressionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCompressionDUnitTest.java
deleted file mode 100644
index 4279dd3..0000000
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCompressionDUnitTest.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.cache30;
-
-import com.gemstone.gemfire.cache.AttributesFactory;
-import com.gemstone.gemfire.cache.RegionAttributes;
-import com.gemstone.gemfire.compression.Compressor;
-import com.gemstone.gemfire.compression.SnappyCompressor;
-
-/**
- * Tests Global Region with compression.
- * 
- * @author rholmes
- * @since 8.0
- */
-@SuppressWarnings({ "deprecation", "serial" })
-public class GlobalRegionCompressionDUnitTest extends GlobalRegionDUnitTest {
-  
-  public GlobalRegionCompressionDUnitTest(String name) {
-    super(name);
-  }
-
-  @SuppressWarnings({ "rawtypes", "unchecked" })
-  @Override
-  protected RegionAttributes getRegionAttributes() {
-    Compressor compressor = null;
-    try {
-      compressor = SnappyCompressor.getDefaultInstance();
-    } catch (Throwable t) {
-      // Not a supported OS
-      return super.getRegionAttributes();
-    }
-    RegionAttributes attrs = super.getRegionAttributes();
-    AttributesFactory factory = new AttributesFactory(attrs);
-    factory.setCompressor(compressor);
-    return factory.create();
-  }
-  
-  @SuppressWarnings({ "rawtypes", "unchecked" })
-  @Override
-  protected RegionAttributes getRegionAttributes(String type) {
-    Compressor compressor = null;
-    try {
-      compressor = SnappyCompressor.getDefaultInstance();
-    } catch (Throwable t) {
-      // Not a supported OS
-      return super.getRegionAttributes(type);
-    }
-    RegionAttributes ra = super.getRegionAttributes(type);
-    AttributesFactory factory = new AttributesFactory(ra);
-    if(!ra.getDataPolicy().isEmpty()) {
-      factory.setCompressor(compressor);
-    }
-    return factory.create();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
index afd87d4..afb4687 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
@@ -82,6 +82,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
     super.setUp();
     port1 = -1;
     port2 = -1;
+    addExpectedException("Removing shunned member");
   }
   
   @Override
@@ -124,7 +125,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
     final Properties properties = new Properties();
     properties.put("mcast-port", "0");
     properties.put("start-locator", locators);
-    properties.put("log-level", "finer");
+    properties.put("log-level", getDUnitLogLevel());
 //    properties.put("log-level", getDUnitLogLevel());
     properties.put("security-peer-auth-init","com.gemstone.gemfire.distributed.AuthInitializer.create");
     properties.put("security-peer-authenticator","com.gemstone.gemfire.distributed.MyAuthenticator.create");
@@ -136,8 +137,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
         DistributionManager.NORMAL_DM_TYPE, system.getDistributedMember().getVmKind());
     
     properties.remove("start-locator");
-    properties.put("log-level", "finer");
-//  properties.put("log-level", getDUnitLogLevel());
+    properties.put("log-level", getDUnitLogLevel());
     properties.put("locators", locators);
     SerializableRunnable startSystem = new SerializableRunnable("start system") {
       public void run() {
@@ -196,8 +196,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
       });
   
       properties.put("start-locator", locators);
-//    properties.put("log-level", getDUnitLogLevel());
-      properties.put("log-level", "finer");
+      properties.put("log-level", getDUnitLogLevel());
       system = (InternalDistributedSystem)DistributedSystem.connect(properties);
       System.out.println("done connecting distributed system");
       
@@ -494,7 +493,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
     properties.put("enable-network-partition-detection", "true");
     properties.put("disable-auto-reconnect", "true");
     properties.put("member-timeout", "2000");
-//    properties.put("log-level", "fine");
+    properties.put("log-level", getDUnitLogLevel());
     properties.put(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "false");
     
     try {
@@ -772,7 +771,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
     properties.put("enable-network-partition-detection", "true");
     properties.put("disable-auto-reconnect", "true");
     properties.put("member-timeout", "2000");
-//    properties.put("log-level", "fine");
+    properties.put("log-level", getDUnitLogLevel());
     properties.put(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "false");
 
     SerializableRunnable stopLocator = getStopLocatorRunnable();
@@ -1123,16 +1122,17 @@ public class LocatorDUnitTest extends DistributedTestCase {
 
     vm0.invoke(getStopLocatorRunnable());
     
-    // now ensure that none of the remaining members became the coordinator
+    // now ensure that one of the remaining members became the coordinator
     WaitCriterion ev = new WaitCriterion() {
       public boolean done() {
         return !coord.equals(MembershipManagerHelper.getCoordinator(system));
       }
       public String description() {
-        return null;
+        return "expected the coordinator to be " + coord + " but it is " +
+          MembershipManagerHelper.getCoordinator(system);
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 5 * 1000, 200, true);
+    DistributedTestCase.waitForCriterion(ev, 15 * 1000, 200, true);
     DistributedMember newCoord = MembershipManagerHelper.getCoordinator(system); 
     getLogWriter().info("coordinator after shutdown of locator was " +
         newCoord);
@@ -1167,7 +1167,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
    * is correct.  It then restarts the locator to demonstrate that
    * it can connect to and function as the group coordinator
    */
-  public void testOneStoppedLocator() throws Exception {
+  public void testLocatorBecomesCoordinator() throws Exception {
     disconnectAllFromDS();
     final String expected = "java.net.ConnectException";
     final String addExpected = 
@@ -1217,10 +1217,11 @@ public class LocatorDUnitTest extends DistributedTestCase {
         return !coord.equals(MembershipManagerHelper.getCoordinator(system));
       }
       public String description() {
-        return null;
+        return "expected the coordinator to be " + coord + " but it is " +
+          MembershipManagerHelper.getCoordinator(system);
       }
     };
-    DistributedTestCase.waitForCriterion(ev, 5000, 200, true);
+    DistributedTestCase.waitForCriterion(ev, 15000, 200, true);
     DistributedMember newCoord = MembershipManagerHelper.getCoordinator(system); 
     getLogWriter().info("coordinator after shutdown of locator was " +
         newCoord);
@@ -1443,7 +1444,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
             Properties props = new Properties();
             props.setProperty("mcast-port", String.valueOf(mcastport));
             props.setProperty("locators", locators);
-//            props.setProperty("log-level", "fine");
+            props.setProperty("log-level", getDUnitLogLevel());
             props.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "false");
 
             Locator.startLocatorAndDS(port1, logFile, null, props);
@@ -1460,7 +1461,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
             Properties props = new Properties();
             props.setProperty("mcast-port", String.valueOf(mcastport));
             props.setProperty("locators", locators);
-//            props.setProperty("log-level", "fine");
+            props.setProperty("log-level", getDUnitLogLevel());
             props.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "false");
             Locator.startLocatorAndDS(port2, logFile, null, props);
           }
@@ -1645,6 +1646,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
     port1 =
       AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     File logFile1 = new File("");
+    deleteLocatorStateFile(port1);
     Locator locator1 = Locator.startLocator(port1, logFile1);
     
     try {
@@ -1653,7 +1655,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
       AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     File logFile2 = new File("");
 
-    deleteLocatorStateFile(port1, port2);
+    deleteLocatorStateFile(port2);
     
     try {
       Locator locator2 = Locator.startLocator(port2, logFile2);
@@ -1671,6 +1673,7 @@ public class LocatorDUnitTest extends DistributedTestCase {
             Properties props = new Properties();
             props.setProperty("mcast-port", "0");
             props.setProperty("locators", locators);
+            props.setProperty("log-level", getDUnitLogLevel());
             DistributedSystem.connect(props);
           }
         };
@@ -1789,7 +1792,8 @@ public class LocatorDUnitTest extends DistributedTestCase {
           System.setProperty("gemfire.disable-floating-coordinator", "true");
           System.setProperty("p2p.joinTimeout", "1000");
           Properties locProps = new Properties();
-          locProps.setProperty("mcast-port", "0");
+          locProps.put("mcast-port", "0");
+          locProps.put("log-level", getDUnitLogLevel());
           Locator.startLocatorAndDS(port, logFile, locProps);
         } catch (IOException ex) {
           fail("While starting locator on port " + port, ex);
@@ -1829,8 +1833,10 @@ public class LocatorDUnitTest extends DistributedTestCase {
         while (unboundedWait && System.currentTimeMillis() < giveUp) {
           pause(1000);
         }
+      } else {
+        cause.printStackTrace();
       }
-      System.out.println("TestHook exiting");
+      InternalDistributedSystem.getLoggerI18n().fine("TestHook exiting");
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/MembershipJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/MembershipJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/MembershipJUnitTest.java
index d261e66..f7683f9 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/MembershipJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/MembershipJUnitTest.java
@@ -181,11 +181,21 @@ public class MembershipJUnitTest extends TestCase {
       System.out.println("creating 2nd membership manager");
       m2 = MemberFactory.newMembershipManager(listener2, config, transport, stats2);
       
-      assert m2.getView().size() == 2 : "view = " + m2.getView();
-      assert m1.getView().size() == 2 : "view = " + m1.getView();
-      assert m1.getView().getCreator().equals(m2.getView().getCreator());
-      assert m1.getView().getViewId() == m2.getView().getViewId();
-      
+      long giveUp = System.currentTimeMillis() + 10000;
+      for (;;) {
+        try {
+          assert m2.getView().size() == 2 : "view = " + m2.getView();
+          assert m1.getView().size() == 2 : "view = " + m1.getView();
+          assert m1.getView().getCreator().equals(m2.getView().getCreator());
+          assert m1.getView().getViewId() == m2.getView().getViewId();
+          break;
+        } catch  (AssertionError e) {
+          if (System.currentTimeMillis() > giveUp) {
+            throw e;
+          }
+        }
+      }
+        
       m2.shutdown();
       assert !m2.isConnected();
       

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/MembershipManagerHelper.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/MembershipManagerHelper.java b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/MembershipManagerHelper.java
index 19396f6..8330c07 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/MembershipManagerHelper.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/MembershipManagerHelper.java
@@ -147,7 +147,14 @@ public class MembershipManagerHelper
   public static void crashDistributedSystem(final DistributedSystem msys) {
     MembershipManagerHelper.inhibitForcedDisconnectLogging(true);
     MembershipManagerHelper.playDead(msys);
-    ((GMSMembershipManager)getMembershipManager(msys)).forceDisconnect("for testing");
+    GMSMembershipManager mgr = ((GMSMembershipManager)getMembershipManager(msys));
+    mgr.forceDisconnect("for testing");
+    while (msys.isConnected()) {
+      try { Thread.sleep(1000); } catch (InterruptedException e) {
+        Thread.currentThread().interrupt();
+        return;
+      }
+    }
     MembershipManagerHelper.inhibitForcedDisconnectLogging(false);
   }
   

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSHealthMonitorJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSHealthMonitorJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSHealthMonitorJUnitTest.java
index 8910d77..881b08a 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSHealthMonitorJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSHealthMonitorJUnitTest.java
@@ -24,10 +24,11 @@ import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedM
 import com.gemstone.gemfire.distributed.internal.membership.NetView;
 import com.gemstone.gemfire.distributed.internal.membership.gms.ServiceConfig;
 import com.gemstone.gemfire.distributed.internal.membership.gms.Services;
+import com.gemstone.gemfire.distributed.internal.membership.gms.Services.Stopper;
 import com.gemstone.gemfire.distributed.internal.membership.gms.fd.GMSHealthMonitor;
 import com.gemstone.gemfire.distributed.internal.membership.gms.interfaces.Messenger;
-import com.gemstone.gemfire.distributed.internal.membership.gms.messages.PingRequestMessage;
-import com.gemstone.gemfire.distributed.internal.membership.gms.messages.PingResponseMessage;
+import com.gemstone.gemfire.distributed.internal.membership.gms.messages.CheckRequestMessage;
+import com.gemstone.gemfire.distributed.internal.membership.gms.messages.CheckResponseMessage;
 import com.gemstone.gemfire.distributed.internal.membership.gms.messages.RemoveMemberMessage;
 import com.gemstone.gemfire.distributed.internal.membership.gms.messages.SuspectMembersMessage;
 import com.gemstone.gemfire.distributed.internal.membership.gms.messages.SuspectRequest;
@@ -53,12 +54,15 @@ public class GMSHealthMonitorJUnitTest {
     messenger = mock(Messenger.class);
     joinLeave = mock(GMSJoinLeave.class);
     services = mock(Services.class);
+    Stopper stopper = mock(Stopper.class);
 
     when(mockConfig.getDistributionConfig()).thenReturn(mockDistConfig);
     when(mockConfig.getMemberTimeout()).thenReturn(memberTimeout);
     when(services.getConfig()).thenReturn(mockConfig);
     when(services.getMessenger()).thenReturn(messenger);
-    when(services.getJoinLeave()).thenReturn(joinLeave);   
+    when(services.getJoinLeave()).thenReturn(joinLeave);
+    when(services.getCancelCriterion()).thenReturn(stopper);
+    when(stopper.isCancelInProgress()).thenReturn(false);
 
     mockMembers = new ArrayList<InternalDistributedMember>();
     for (int i = 0; i < 7; i++) {
@@ -87,17 +91,17 @@ public class GMSHealthMonitorJUnitTest {
     MethodExecuted messageSent = new MethodExecuted();
     InternalDistributedMember mbr = new InternalDistributedMember(SocketCreator.getLocalHost(), 12345);
     when(messenger.getMemberID()).thenReturn(mbr);
-    when(messenger.send(any(PingResponseMessage.class))).thenAnswer(messageSent);
+    when(messenger.send(any(CheckResponseMessage.class))).thenAnswer(messageSent);
 
-    gmsHealthMonitor.processMessage(new PingRequestMessage(mbr, 1));
-    Assert.assertTrue("Ping Response should have been sent", messageSent.isMethodExecuted());
+    gmsHealthMonitor.processMessage(new CheckRequestMessage(mbr, 1));
+    Assert.assertTrue("Check Response should have been sent", messageSent.isMethodExecuted());
   }
 
   /**
-   * checks whether we get local member id or not to set next neighbour
+   * checks whether we get local member id or not to set next neighbor
    */
   @Test
-  public void testHMNextNeighbour() throws IOException {
+  public void testHMNextNeighbor() throws IOException {
 
     NetView v = new NetView(mockMembers.get(0), 2, mockMembers, new HashSet<InternalDistributedMember>(), new HashSet<InternalDistributedMember>());
 
@@ -110,10 +114,10 @@ public class GMSHealthMonitorJUnitTest {
   }
 
   /**
-   * checks who is next neighbour
+   * checks who is next neighbor
    */
   @Test
-  public void testHMNextNeighbourVerify() throws IOException {
+  public void testHMNextNeighborVerify() throws IOException {
 
     NetView v = new NetView(mockMembers.get(0), 2, mockMembers, new HashSet<InternalDistributedMember>(), new HashSet<InternalDistributedMember>());
 
@@ -121,16 +125,16 @@ public class GMSHealthMonitorJUnitTest {
 
     gmsHealthMonitor.installView(v);
 
-    Assert.assertEquals(mockMembers.get(4), gmsHealthMonitor.getNextNeighbour());
+    Assert.assertEquals(mockMembers.get(4), gmsHealthMonitor.getNextNeighbor());
 
   }
 
   /**
-   * it checks neighbour after membertimeout, it should be different
+   * it checks neighbor after membertimeout, it should be different
    */
 
   @Test
-  public void testHMNextNeighbourAfterTimeout() throws IOException {
+  public void testHMNextNeighborAfterTimeout() throws IOException {
 
     NetView v = new NetView(mockMembers.get(0), 2, mockMembers, new HashSet<InternalDistributedMember>(), new HashSet<InternalDistributedMember>());
 
@@ -144,16 +148,16 @@ public class GMSHealthMonitorJUnitTest {
       Thread.sleep(memberTimeout + 5);
     } catch (InterruptedException e) {
     }
-    // neighbour should change to 5th
-    Assert.assertEquals(mockMembers.get(5), gmsHealthMonitor.getNextNeighbour());
+    // neighbor should change to 5th
+    Assert.assertEquals(mockMembers.get(5), gmsHealthMonitor.getNextNeighbor());
   }
 
   /**
-   * it checks neighbour before membertiemout, it should be same
+   * it checks neighbor before membertiemout, it should be same
    */
 
   @Test
-  public void testHMNextNeighbourBeforeTimeout() throws IOException {
+  public void testHMNextNeighborBeforeTimeout() throws IOException {
 
     NetView v = new NetView(mockMembers.get(0), 2, mockMembers, new HashSet<InternalDistributedMember>(), new HashSet<InternalDistributedMember>());
 
@@ -163,12 +167,12 @@ public class GMSHealthMonitorJUnitTest {
     gmsHealthMonitor.installView(v);
 
     try {
-      // member-timeout is 1000 ms, so next neighbour should be same
+      // member-timeout is 1000 ms, so next neighbor should be same
       Thread.sleep(memberTimeout - 200);
     } catch (InterruptedException e) {
     }
-    // neighbour should be same
-    Assert.assertEquals(mockMembers.get(4), gmsHealthMonitor.getNextNeighbour());
+    // neighbor should be same
+    Assert.assertEquals(mockMembers.get(4), gmsHealthMonitor.getNextNeighbor());
   }
 
   /***

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
index fac9ae8..0af47a7 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
@@ -29,6 +29,8 @@ import com.gemstone.gemfire.distributed.internal.membership.gms.Services.Stopper
 import com.gemstone.gemfire.distributed.internal.membership.gms.interfaces.Authenticator;
 import com.gemstone.gemfire.distributed.internal.membership.gms.interfaces.Manager;
 import com.gemstone.gemfire.distributed.internal.membership.gms.interfaces.Messenger;
+import com.gemstone.gemfire.distributed.internal.membership.gms.locator.FindCoordinatorResponse;
+import com.gemstone.gemfire.distributed.internal.membership.gms.membership.GMSJoinLeave.SearchState;
 import com.gemstone.gemfire.distributed.internal.membership.gms.messages.InstallViewMessage;
 import com.gemstone.gemfire.distributed.internal.membership.gms.messages.JoinRequestMessage;
 import com.gemstone.gemfire.distributed.internal.membership.gms.messages.JoinResponseMessage;
@@ -39,6 +41,8 @@ import com.gemstone.gemfire.internal.Version;
 import com.gemstone.gemfire.security.AuthenticationFailedException;
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
 
+import dunit.standalone.DUnitLauncher;
+
 @Category(UnitTest.class)
 public class GMSJoinLeaveJUnitTest {
   private Services services;
@@ -98,6 +102,41 @@ public class GMSJoinLeaveJUnitTest {
   }
   
   @Test
+  public void testFindCoordinatorInView() throws Exception {
+    initMocks();
+
+    int viewId = 1;
+    List<InternalDistributedMember> mbrs = new LinkedList<>();
+    Set<InternalDistributedMember> shutdowns = new HashSet<>();
+    Set<InternalDistributedMember> crashes = new HashSet<>();
+    mbrs.add(mockMembers[0]);
+    mbrs.add(mockMembers[1]);
+    
+    when(services.getMessenger()).thenReturn(messenger);
+    
+    //prepare the view
+    NetView netView = new NetView(mockMembers[0], viewId, mbrs, shutdowns, crashes);
+    SearchState state = gmsJoinLeave.searchState;
+    state.view = netView;
+    state.viewId = netView.getViewId();
+    // already tried joining using member 0
+    Set<InternalDistributedMember> set = new HashSet<>();
+    set.add(mockMembers[1]);
+    state.alreadyTried = set;
+    state.hasContactedALocator = true;
+    // simulate a response being received
+    FindCoordinatorResponse resp = new FindCoordinatorResponse(mockMembers[1], mockMembers[2]);
+    gmsJoinLeave.processMessage(resp);
+    // tell GMSJoinLeave that a unit test is running so it won't clear the
+    // responses collection
+    gmsJoinLeave.unitTesting.add("findCoordinatorFromView");
+    // now for the test
+    boolean result = gmsJoinLeave.findCoordinatorFromView();
+    assert result : "should have found coordinator " + mockMembers[2];
+    assert state.possibleCoordinator == mockMembers[2] : "should have found " + mockMembers[2] + " but found " + state.possibleCoordinator;
+  }
+  
+  @Test
   public void testProcessJoinMessageRejectOldMemberVersion() throws IOException {
     initMocks();
  
@@ -252,6 +291,7 @@ public class GMSJoinLeaveJUnitTest {
   public void testDuplicateLeaveRequestDoesNotCauseNewView() throws Exception {
     String reason = "testing";
     initMocks();
+    gmsJoinLeave.unitTesting.add("noRandomViewChange");
     prepareAndInstallView();
     gmsJoinLeave.getView().add(gmsJoinLeaveMemberId);
     gmsJoinLeave.becomeCoordinator();
@@ -279,6 +319,7 @@ public class GMSJoinLeaveJUnitTest {
     prepareAndInstallView();
     gmsJoinLeave.getView().add(gmsJoinLeaveMemberId);
     gmsJoinLeave.getView().add(mockMembers[1]);
+    gmsJoinLeave.unitTesting.add("noRandomViewChange");
     gmsJoinLeave.becomeCoordinator();
     RemoveMemberMessage msg = new RemoveMemberMessage(gmsJoinLeave.getMemberID(), mockMembers[0], reason);
     msg.setSender(mockMembers[0]);
@@ -300,6 +341,7 @@ public class GMSJoinLeaveJUnitTest {
   @Test
   public void testDuplicateJoinRequestDoesNotCauseNewView() throws Exception {
     initMocks();
+    gmsJoinLeave.unitTesting.add("noRandomViewChange");
     prepareAndInstallView();
     gmsJoinLeave.getView().add(gmsJoinLeaveMemberId);
     gmsJoinLeave.getView().add(mockMembers[1]);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionTimeOutDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionTimeOutDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionTimeOutDUnitTest.java
index 2f45e5f..ab0e3bb 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionTimeOutDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionTimeOutDUnitTest.java
@@ -789,6 +789,7 @@ public class PRFunctionExecutionTimeOutDUnitTest extends
     final VM datastore1 = host.getVM(1);
     final VM datastore2 = host.getVM(2);
     final VM datastore3 = host.getVM(3);
+    addExpectedException("BucketMovedException");
     getCache();
     SerializableCallable dataStoreCreate = new SerializableCallable(
         "Create PR with Function Factory") {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/eab327f6/gemfire-core/src/test/java/dunit/standalone/DUnitLauncher.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/dunit/standalone/DUnitLauncher.java b/gemfire-core/src/test/java/dunit/standalone/DUnitLauncher.java
index c21dd72..6d26ed7 100644
--- a/gemfire-core/src/test/java/dunit/standalone/DUnitLauncher.java
+++ b/gemfire-core/src/test/java/dunit/standalone/DUnitLauncher.java
@@ -69,6 +69,9 @@ import dunit.VM;
  */
 public class DUnitLauncher {
 
+  /** change this to use a different log level in unit tests */
+  public static final String LOG_LEVEL = System.getProperty("logLevel", "info");
+  
   static int locatorPort;
 
   private static final int NUM_VMS = 4;
@@ -80,7 +83,6 @@ public class DUnitLauncher {
   private static File DUNIT_SUSPECT_FILE;
 
   public static final String DUNIT_DIR = "dunit";
-  public static final String LOG_LEVEL = System.getProperty("logLevel", "config");
   public static final String WORKSPACE_DIR_PARAM = "WORKSPACE_DIR";
   public static final boolean LOCATOR_LOG_TO_DISK = Boolean.getBoolean("locatorLogToDisk");
 


Mime
View raw message