geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject [03/38] incubator-geode git commit: GEODE-634 CI failure: DistributedMemberDUnitTest.testRolesInAllVMs
Date Tue, 26 Jan 2016 19:38:26 GMT
GEODE-634 CI failure: DistributedMemberDUnitTest.testRolesInAllVMs

Fixed the suspect string and added unit tests.  I also added a new constructor
in NetView and modified tests that were using the full constructor with
empty crashed/left member sets to use it.  That simplified their code a bit.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/46bd5167
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/46bd5167
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/46bd5167

Branch: refs/heads/wan_cq_donation
Commit: 46bd5167c4d05525b92cb3e7d9bf1aa06b079fcf
Parents: b4cdc2a
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Fri Jan 22 16:02:14 2016 -0800
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Fri Jan 22 16:05:50 2016 -0800

----------------------------------------------------------------------
 .../internal/membership/NetView.java            | 10 ++++++
 .../gms/messenger/JGroupsMessenger.java         |  3 ++
 .../internal/membership/NetViewJUnitTest.java   | 19 ++++-------
 .../gms/fd/GMSHealthMonitorJUnitTest.java       | 26 +++++++--------
 .../gms/membership/GMSJoinLeaveJUnitTest.java   | 34 ++++++-------------
 .../messenger/GMSQuorumCheckerJUnitTest.java    |  4 +--
 .../messenger/JGroupsMessengerJUnitTest.java    | 35 ++++++++++++++++++++
 .../gms/mgr/GMSMembershipManagerJUnitTest.java  | 21 ++++++------
 8 files changed, 89 insertions(+), 63 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/46bd5167/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/NetView.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/NetView.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/NetView.java
index 6a68619..5f68056 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/NetView.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/NetView.java
@@ -77,6 +77,16 @@ public class NetView implements DataSerializableFixedID {
     Arrays.fill(failureDetectionPorts, -1);
   }
 
+  public NetView(InternalDistributedMember creator, int viewId, List<InternalDistributedMember>
members) {
+    this.viewId = 0;
+    this.members = new ArrayList<InternalDistributedMember>(members);
+    hashedMembers = new HashSet<>(members);
+    shutdownMembers = new HashSet<>();
+    crashedMembers = Collections.emptySet();
+    this.creator = creator;
+    Arrays.fill(failureDetectionPorts, -1);
+  }
+
   // legacy method for JGMM
   public NetView(int size, long viewId) {
     this.viewId = (int) viewId;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/46bd5167/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 bdf13b5..ccff687 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
@@ -379,6 +379,9 @@ public class JGroupsMessenger implements Messenger {
    * see Transport._send()
    */
   public void handleJGroupsIOException(IOException e, Address dest) {
+    if (services.getManager().shutdownInProgress()) { // GEODE-634 - don't log IOExceptions
during shutdown
+      return;
+    }
     if (addressesWithioExceptionsProcessed.contains(dest)) {
       return;
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/46bd5167/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/NetViewJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/NetViewJUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/NetViewJUnitTest.java
index f21ac4c..dd7b432 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/NetViewJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/NetViewJUnitTest.java
@@ -85,7 +85,7 @@ public class NetViewJUnitTest {
   @Test
   public void testCreateView() throws Exception {
     int numMembers = members.size();
-    NetView view = new NetView(members.get(0), 2, members, Collections.emptySet(), Collections.emptySet());
+    NetView view = new NetView(members.get(0), 2, members);
     setFailureDetectionPorts(view);
     
     assertTrue(view.getCreator().equals(members.get(0)));
@@ -118,8 +118,7 @@ public class NetViewJUnitTest {
   @Test
   public void testRemoveMembers() throws Exception {
     int numMembers = members.size();
-    NetView view = new NetView(members.get(0), 2, new ArrayList<>(members), Collections.emptySet(),
-        Collections.emptySet());
+    NetView view = new NetView(members.get(0), 2, new ArrayList<>(members));
     setFailureDetectionPorts(view);
 
     for (int i=1; i<numMembers; i+=2) {
@@ -138,8 +137,7 @@ public class NetViewJUnitTest {
   @Test
   public void testRemoveAll() throws Exception {
     int numMembers = members.size();
-    NetView view = new NetView(members.get(0), 2, new ArrayList<>(members), Collections.emptySet(),
-        Collections.emptySet());
+    NetView view = new NetView(members.get(0), 2, new ArrayList<>(members));
     setFailureDetectionPorts(view);
 
     Collection<InternalDistributedMember> removals = new ArrayList<>(numMembers/2);
@@ -163,8 +161,7 @@ public class NetViewJUnitTest {
   
   @Test
   public void testCopyView() throws Exception {
-    NetView view = new NetView(members.get(0), 2, new ArrayList<>(members), Collections.emptySet(),
-        Collections.emptySet());
+    NetView view = new NetView(members.get(0), 2, new ArrayList<>(members));
     setFailureDetectionPorts(view);
 
     NetView newView = new NetView(view, 3);
@@ -184,8 +181,7 @@ public class NetViewJUnitTest {
   
   @Test
   public void testAddLotsOfMembers() throws Exception {
-    NetView view = new NetView(members.get(0), 2, new ArrayList<>(members), Collections.emptySet(),
-        Collections.emptySet());
+    NetView view = new NetView(members.get(0), 2, new ArrayList<>(members));
     setFailureDetectionPorts(view);
     
     NetView copy = new NetView(view, 2);
@@ -243,8 +239,7 @@ public class NetViewJUnitTest {
     for (i=0; i<members.length; i++) {
       vmbrs.add(members[i]);
     }
-    Set<InternalDistributedMember> empty = Collections.emptySet();
-    NetView lastView = new NetView(members[0], 4, vmbrs, empty, empty);
+    NetView lastView = new NetView(members[0], 4, vmbrs);
     InternalDistributedMember leader = members[2];
     assertTrue(!leader.getNetMember().preferredForCoordinator());
     
@@ -261,7 +256,7 @@ public class NetViewJUnitTest {
     failedMembers.add(members[members.length-2]); // admin
     List<InternalDistributedMember> newMbrs = new ArrayList<InternalDistributedMember>(lastView.getMembers());
     newMbrs.removeAll(failedMembers);
-    NetView newView = new NetView(members[0], 5, newMbrs, empty, failedMembers);
+    NetView newView = new NetView(members[0], 5, newMbrs, Collections.emptySet(), failedMembers);
     
     int failedWeight = newView.getCrashedMemberWeight(lastView);
 //    System.out.println("last view = " + lastView);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/46bd5167/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java
index 0b19b88..70285c7 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java
@@ -150,7 +150,7 @@ public class GMSHealthMonitorJUnitTest {
     when(messenger.getMemberID()).thenReturn(mbr);
     gmsHealthMonitor.started();
     
-    NetView v = new NetView(mbr, 1, mockMembers, new HashSet<InternalDistributedMember>(),
new HashSet<InternalDistributedMember>());
+    NetView v = new NetView(mbr, 1, mockMembers);
 
     gmsHealthMonitor.processMessage(new HeartbeatRequestMessage(mbr, 1));
     verify(messenger, atLeastOnce()).send(any(HeartbeatMessage.class));
@@ -164,7 +164,7 @@ public class GMSHealthMonitorJUnitTest {
   @Test
   public void testHMNextNeighborVerify() throws IOException {
 
-    NetView v = new NetView(mockMembers.get(0), 2, mockMembers, new HashSet<InternalDistributedMember>(),
new HashSet<InternalDistributedMember>());
+    NetView v = new NetView(mockMembers.get(0), 2, mockMembers);
 
     when(messenger.getMemberID()).thenReturn(mockMembers.get(3));
     gmsHealthMonitor.started();
@@ -178,7 +178,7 @@ public class GMSHealthMonitorJUnitTest {
   @Test
   public void testHMNextNeighborAfterTimeout() throws Exception {
     System.out.println("testHMNextNeighborAfterTimeout starting");
-    NetView v = new NetView(mockMembers.get(0), 2, mockMembers, new HashSet<InternalDistributedMember>(),
new HashSet<InternalDistributedMember>());
+    NetView v = new NetView(mockMembers.get(0), 2, mockMembers);
 
 //    System.out.printf("memberID is %s view is %s\n", mockMembers.get(3), v);
     
@@ -210,7 +210,7 @@ public class GMSHealthMonitorJUnitTest {
 
   @Test
   public void testHMNextNeighborBeforeTimeout() throws IOException {
-    NetView v = new NetView(mockMembers.get(0), 2, mockMembers, new HashSet<InternalDistributedMember>(),
new HashSet<InternalDistributedMember>());
+    NetView v = new NetView(mockMembers.get(0), 2, mockMembers);
 
     // 3rd is current member
     when(messenger.getMemberID()).thenReturn(mockMembers.get(3));
@@ -239,7 +239,7 @@ public class GMSHealthMonitorJUnitTest {
   @Test
   public void testSuspectMembersCalledThroughMemberCheckThread() throws Exception {
     System.out.println("testSuspectMembersCalledThroughMemberCheckThread starting");
-    NetView v = new NetView(mockMembers.get(0), 2, mockMembers, new HashSet<InternalDistributedMember>(),
new HashSet<InternalDistributedMember>());
+    NetView v = new NetView(mockMembers.get(0), 2, mockMembers);
 
     // 3rd is current member
     when(messenger.getMemberID()).thenReturn(mockMembers.get(3));
@@ -262,7 +262,7 @@ public class GMSHealthMonitorJUnitTest {
    */
   @Test
   public void testSuspectMembersNotCalledThroughPingThreadBeforeTimeout() {
-    NetView v = new NetView(mockMembers.get(0), 2, mockMembers, new HashSet<InternalDistributedMember>(),
new HashSet<InternalDistributedMember>());
+    NetView v = new NetView(mockMembers.get(0), 2, mockMembers);
 
     // 3rd is current member
     when(messenger.getMemberID()).thenReturn(mockMembers.get(3));
@@ -286,7 +286,7 @@ public class GMSHealthMonitorJUnitTest {
    */
   @Test
   public void testSuspectMembersCalledThroughSuspectThread() throws Exception {
-    NetView v = new NetView(mockMembers.get(0), 2, mockMembers, new HashSet<InternalDistributedMember>(),
new HashSet<InternalDistributedMember>());
+    NetView v = new NetView(mockMembers.get(0), 2, mockMembers);
     
     // 3rd is current member
     when(messenger.getMemberID()).thenReturn(mockMembers.get(3));
@@ -308,7 +308,7 @@ public class GMSHealthMonitorJUnitTest {
   @Test
   public void testSuspectMembersNotCalledThroughSuspectThreadBeforeTimeout() {
 
-    NetView v = new NetView(mockMembers.get(0), 2, mockMembers, new HashSet<InternalDistributedMember>(),
new HashSet<InternalDistributedMember>());
+    NetView v = new NetView(mockMembers.get(0), 2, mockMembers);
 
     // 3rd is current member
     when(messenger.getMemberID()).thenReturn(mockMembers.get(3));
@@ -334,7 +334,7 @@ public class GMSHealthMonitorJUnitTest {
   @Test
   public void testRemoveMemberCalled() throws Exception {
     System.out.println("testRemoveMemberCalled starting");
-    NetView v = new NetView(mockMembers.get(0), 2, mockMembers, new HashSet<InternalDistributedMember>(),
new HashSet<InternalDistributedMember>());
+    NetView v = new NetView(mockMembers.get(0), 2, mockMembers);
 
     // 3rd is current member
     when(messenger.getMemberID()).thenReturn(mockMembers.get(0)); // coordinator and local
member
@@ -367,7 +367,7 @@ public class GMSHealthMonitorJUnitTest {
   @Test
   public void testRemoveMemberNotCalledBeforeTimeout() {
     System.out.println("testRemoveMemberNotCalledBeforeTimeout starting");
-    NetView v = new NetView(mockMembers.get(0), 2, mockMembers, new HashSet<InternalDistributedMember>(),
new HashSet<InternalDistributedMember>());
+    NetView v = new NetView(mockMembers.get(0), 2, mockMembers);
 
     // 3rd is current member
     when(messenger.getMemberID()).thenReturn(mockMembers.get(0)); // coordinator and local
member
@@ -404,7 +404,7 @@ public class GMSHealthMonitorJUnitTest {
   @Test
   public void testRemoveMemberCalledAfterDoingFinalCheckOnCoordinator() throws Exception
{
 
-    NetView v = new NetView(mockMembers.get(0), 2, mockMembers, new HashSet<InternalDistributedMember>(),
new HashSet<InternalDistributedMember>());
+    NetView v = new NetView(mockMembers.get(0), 2, mockMembers);
 
     // preferred coordinators are 0 and 1
     when(messenger.getMemberID()).thenReturn(mockMembers.get(1));// next preferred coordinator
@@ -466,7 +466,7 @@ public class GMSHealthMonitorJUnitTest {
   @Test
   public void testShutdown() {
 
-    NetView v = new NetView(mockMembers.get(0), 2, mockMembers, new HashSet<InternalDistributedMember>(),
new HashSet<InternalDistributedMember>());
+    NetView v = new NetView(mockMembers.get(0), 2, mockMembers);
 
     // 3rd is current member
     when(messenger.getMemberID()).thenReturn(mockMembers.get(3));
@@ -578,7 +578,7 @@ public class GMSHealthMonitorJUnitTest {
   
   @Test
   public void testBeSickAndPlayDead() throws Exception {
-    NetView v = new NetView(mockMembers.get(0), 2, mockMembers, new HashSet<InternalDistributedMember>(),
new HashSet<InternalDistributedMember>());
+    NetView v = new NetView(mockMembers.get(0), 2, mockMembers);
     gmsHealthMonitor.installView(v);
     gmsHealthMonitor.beSick();
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/46bd5167/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 bc63f0d..ca699b5 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
@@ -153,8 +153,6 @@ public class GMSJoinLeaveJUnitTest {
 
     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]);
     mbrs.add(mockMembers[2]);
@@ -162,7 +160,7 @@ public class GMSJoinLeaveJUnitTest {
     when(services.getMessenger()).thenReturn(messenger);
     
     //prepare the view
-    NetView netView = new NetView(mockMembers[0], viewId, mbrs, shutdowns, crashes);
+    NetView netView = new NetView(mockMembers[0], viewId, mbrs);
     SearchState state = gmsJoinLeave.searchState;
     state.view = netView;
     state.viewId = netView.getViewId();
@@ -207,8 +205,7 @@ public class GMSJoinLeaveJUnitTest {
     initMocks();
     gmsJoinLeave.becomeCoordinatorForTest();
     List<InternalDistributedMember> members = Arrays.asList(mockMembers);
-    Set<InternalDistributedMember> empty = Collections.<InternalDistributedMember>emptySet();
-    NetView v = new NetView(mockMembers[0], 2, members, empty, empty);
+    NetView v = new NetView(mockMembers[0], 2, members);
     InstallViewMessage message = new InstallViewMessage(v, null);
     gmsJoinLeave.processMessage(message);
     verify(manager).forceDisconnect(any(String.class));
@@ -260,13 +257,11 @@ public class GMSJoinLeaveJUnitTest {
    */
   private void prepareAndInstallView(InternalDistributedMember coordinator, List<InternalDistributedMember>
members) throws IOException {
     int viewId = 1;
-    Set<InternalDistributedMember> shutdowns = new HashSet<>();
-    Set<InternalDistributedMember> crashes = new HashSet<>();
     
     when(services.getMessenger()).thenReturn(messenger);
     
     //prepare the view
-    NetView netView = new NetView(coordinator, viewId, members, shutdowns, crashes);
+    NetView netView = new NetView(coordinator, viewId, members);
     InstallViewMessage installViewMessage = new InstallViewMessage(netView, credentials,
true);
     gmsJoinLeave.processMessage(installViewMessage);
     verify(messenger).send(any(ViewAckMessage.class));
@@ -340,13 +335,11 @@ public class GMSJoinLeaveJUnitTest {
     prepareAndInstallView(mockMembers[0], createMemberList(mockMembers[0], gmsJoinLeaveMemberId));
     
     List<InternalDistributedMember> mbrs = new LinkedList<>();
-    Set<InternalDistributedMember> shutdowns = new HashSet<>();
-    Set<InternalDistributedMember> crashes = new HashSet<>();
     mbrs.add(mockMembers[0]);
     mbrs.add(mockMembers[1]);
   
     //try to install an older view where viewId < currentView.viewId
-    NetView olderNetView = new NetView(mockMembers[0], 0, mbrs, shutdowns, crashes);
+    NetView olderNetView = new NetView(mockMembers[0], 0, mbrs);
     InstallViewMessage installViewMessage = new InstallViewMessage(olderNetView, credentials,
false);
     gmsJoinLeave.processMessage(installViewMessage);
     Assert.assertNotEquals(gmsJoinLeave.getView(), olderNetView);
@@ -361,14 +354,12 @@ public class GMSJoinLeaveJUnitTest {
 
     int viewId = 2;
     List<InternalDistributedMember> mbrs = new LinkedList<>();
-    Set<InternalDistributedMember> shutdowns = new HashSet<>();
-    Set<InternalDistributedMember> crashes = new HashSet<>();
     mbrs.add(mockMembers[1]);
     mbrs.add(mockMembers[2]);
     mbrs.add(mockMembers[3]);
    
     //install the view
-    NetView netView = new NetView(mockMembers[0], viewId, mbrs, shutdowns, crashes);
+    NetView netView = new NetView(mockMembers[0], viewId, mbrs);
     InstallViewMessage installViewMessage = new InstallViewMessage(netView, credentials,
false);
     gmsJoinLeave.processMessage(installViewMessage);
     
@@ -618,8 +609,6 @@ public class GMSJoinLeaveJUnitTest {
     // where enough weight is lost to cause a network partition
     
     List<InternalDistributedMember> mbrs = new LinkedList<>();
-    Set<InternalDistributedMember> shutdowns = new HashSet<>();
-    Set<InternalDistributedMember> crashes = new HashSet<>();
     mbrs.add(mockMembers[0]);
     mbrs.add(mockMembers[1]);
     mbrs.add(mockMembers[2]);
@@ -627,17 +616,17 @@ public class GMSJoinLeaveJUnitTest {
     
     ((GMSMember)mockMembers[1].getNetMember()).setMemberWeight((byte)20);
   
-    NetView newView = new NetView(mockMembers[0], gmsJoinLeave.getView().getViewId()+1, mbrs,
shutdowns, crashes);
+    NetView newView = new NetView(mockMembers[0], gmsJoinLeave.getView().getViewId()+1, mbrs);
     InstallViewMessage installViewMessage = new InstallViewMessage(newView, credentials,
false);
     gmsJoinLeave.processMessage(installViewMessage);
     
-    crashes = new HashSet<>(crashes);
+    Set<InternalDistributedMember> crashes = new HashSet<>();
     crashes.add(mockMembers[1]);
     crashes.add(mockMembers[2]);
     mbrs = new LinkedList<>(mbrs);
     mbrs.remove(mockMembers[1]);
     mbrs.remove(mockMembers[2]);
-    NetView partitionView = new NetView(mockMembers[0], newView.getViewId()+1, mbrs, shutdowns,
crashes);
+    NetView partitionView = new NetView(mockMembers[0], newView.getViewId()+1, mbrs, Collections.emptySet(),
crashes);
     installViewMessage = new InstallViewMessage(partitionView, credentials, false);
     gmsJoinLeave.processMessage(installViewMessage);
     
@@ -800,7 +789,7 @@ public class GMSJoinLeaveJUnitTest {
     gmsJoinLeave.memberShutdown(mockMembers[2], "Shutdown");
     
     //Install a view that still contains one of the left members (as if something like a
new member, triggered a new view before coordinator leaves)
-    NetView netView = new NetView(mockMembers[0], 3/*new view id*/, createMemberList(mockMembers[0],
gmsJoinLeaveMemberId, mockMembers[1], mockMembers[3]), new HashSet<InternalDistributedMember>(),
new HashSet<InternalDistributedMember>());
+    NetView netView = new NetView(mockMembers[0], 3/*new view id*/, createMemberList(mockMembers[0],
gmsJoinLeaveMemberId, mockMembers[1], mockMembers[3]));
     InstallViewMessage installViewMessage = new InstallViewMessage(netView, credentials,
false);
     gmsJoinLeave.processMessage(installViewMessage);
     
@@ -829,13 +818,10 @@ public class GMSJoinLeaveJUnitTest {
   }
   
   private void installView(int viewId,InternalDistributedMember coordinator, List<InternalDistributedMember>
members) throws IOException {
-    Set<InternalDistributedMember> shutdowns = new HashSet<>();
-    Set<InternalDistributedMember> crashes = new HashSet<>();
-    
     when(services.getMessenger()).thenReturn(messenger);
     
     //prepare the view
-    NetView netView = new NetView(coordinator, viewId, members, shutdowns, crashes);
+    NetView netView = new NetView(coordinator, viewId, members);
     InstallViewMessage installViewMessage = new InstallViewMessage(netView, credentials,
false);
     gmsJoinLeave.processMessage(installViewMessage);
    // verify(messenger).send(any(ViewAckMessage.class));

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/46bd5167/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/GMSQuorumCheckerJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/GMSQuorumCheckerJUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/GMSQuorumCheckerJUnitTest.java
index 99f90eb..904a206 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/GMSQuorumCheckerJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/GMSQuorumCheckerJUnitTest.java
@@ -118,14 +118,12 @@ public class GMSQuorumCheckerJUnitTest {
   private NetView prepareView(int numMembers) throws IOException {
     int viewId = 1;
     List<InternalDistributedMember> mbrs = new LinkedList<InternalDistributedMember>();
-    Set<InternalDistributedMember> shutdowns = new HashSet<InternalDistributedMember>();
-    Set<InternalDistributedMember> crashes = new HashSet<InternalDistributedMember>();
     for (int i = 0; i < numMembers; i++) {
       mbrs.add(mockMembers[i]);
     }
 
     // prepare the view
-    NetView netView = new NetView(mockMembers[0], viewId, mbrs, shutdowns, crashes);
+    NetView netView = new NetView(mockMembers[0], viewId, mbrs);
     return netView;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/46bd5167/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/JGroupsMessengerJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/JGroupsMessengerJUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/JGroupsMessengerJUnitTest.java
index f9ed26c..ae55f4f 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/JGroupsMessengerJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/JGroupsMessengerJUnitTest.java
@@ -25,10 +25,12 @@ import java.io.DataInputStream;
 import java.io.DataOutput;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
+import java.util.Set;
 
 import org.apache.commons.lang.SerializationException;
 import org.jgroups.Address;
@@ -154,6 +156,39 @@ public class JGroupsMessengerJUnitTest {
   }
   
   @Test
+  public void ioExceptionInitiatesSuspectProcessing() throws Exception {
+    // see GEODE-634
+    initMocks(false);
+    NetView v = createView();
+    when(joinLeave.getView()).thenReturn(v);
+    messenger.installView(v);
+    messenger.handleJGroupsIOException(new IOException("je m'en fiche"), new JGAddress(v.getMembers().get(1)));
+    verify(healthMonitor).checkIfAvailable(isA(InternalDistributedMember.class), isA(String.class),
isA(Boolean.class));
+  }
+  
+  @Test
+  public void ioExceptionDuringShutdownAvoidsSuspectProcessing() throws Exception {
+    // see GEODE-634
+    initMocks(false);
+    NetView v = createView();
+    when(joinLeave.getView()).thenReturn(v);
+    when(manager.shutdownInProgress()).thenReturn(true);
+    messenger.installView(v);
+    messenger.handleJGroupsIOException(new IOException("fichez-moi le camp"), new JGAddress(v.getMembers().get(1)));
+    verify(healthMonitor, never()).checkIfAvailable(isA(InternalDistributedMember.class),
isA(String.class), isA(Boolean.class));
+  }
+  
+  private NetView createView() {
+    InternalDistributedMember sender = messenger.getMemberID();
+    List<InternalDistributedMember> mbrs = new ArrayList<>();
+    mbrs.add(sender);
+    mbrs.add(createAddress(100));
+    mbrs.add(createAddress(101));
+    NetView v = new NetView(sender, 1, mbrs);
+    return v;
+  }
+  
+  @Test
   public void testMemberWeightIsSerialized() throws Exception {
     HeapDataOutputStream out = new HeapDataOutputStream(500, Version.CURRENT);
     InternalDistributedMember mbr = createAddress(8888);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/46bd5167/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManagerJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManagerJUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManagerJUnitTest.java
index ddbda0b..952f347 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManagerJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/mgr/GMSMembershipManagerJUnitTest.java
@@ -91,7 +91,6 @@ public class GMSMembershipManagerJUnitTest {
   DistributedMembershipListener listener;
   private GMSMembershipManager manager;
   private List<InternalDistributedMember> members;
-  private Set<InternalDistributedMember> emptyMembersSet = new HashSet<>();
   private DirectChannel dc;
 
   @Before
@@ -172,7 +171,7 @@ public class GMSMembershipManagerJUnitTest {
     m.setRecipient(mockMembers[0]);
     manager.start();
     manager.started();
-    manager.installView(new NetView(myMemberId, 1, members, emptyMembersSet, emptyMembersSet));
+    manager.installView(new NetView(myMemberId, 1, members));
     Set<InternalDistributedMember> failures = manager.send(m);
     verify(messenger).send(m);
     if (failures != null) {
@@ -186,7 +185,7 @@ public class GMSMembershipManagerJUnitTest {
        new Date(System.currentTimeMillis()), "thread", "", 1L, "", "");
     manager.start();
     manager.started();
-    manager.installView(new NetView(myMemberId, 1, members, emptyMembersSet, emptyMembersSet));
+    manager.installView(new NetView(myMemberId, 1, members));
     manager.setShutdown();
     Set<InternalDistributedMember> failures = manager.send(m);
     verify(messenger, never()).send(m);
@@ -201,7 +200,7 @@ public class GMSMembershipManagerJUnitTest {
     m.setRecipient(mockMembers[0]);
     manager.start();
     manager.started();
-    manager.installView(new NetView(myMemberId, 1, members, emptyMembersSet, emptyMembersSet));
+    manager.installView(new NetView(myMemberId, 1, members));
     Set<InternalDistributedMember> failures = manager.send(null, m, null);
     verify(messenger, never()).send(m);
     reset(messenger);
@@ -216,7 +215,7 @@ public class GMSMembershipManagerJUnitTest {
     manager.isJoining = true;
 
     List<InternalDistributedMember> viewmembers = Arrays.asList(new InternalDistributedMember[]
{mockMembers[0], myMemberId});
-    manager.installView(new NetView(myMemberId, 2, viewmembers, emptyMembersSet, emptyMembersSet));
+    manager.installView(new NetView(myMemberId, 2, viewmembers));
 
     // add a surprise member that will be shunned due to it's having
     // an old view ID
@@ -248,7 +247,7 @@ public class GMSMembershipManagerJUnitTest {
     // this view officially adds surpriseMember2
     viewmembers = Arrays.asList(
         new InternalDistributedMember[] {mockMembers[0], myMemberId, surpriseMember2});
-    manager.handleOrDeferViewEvent(new NetView(myMemberId, 3, viewmembers, emptyMembersSet,
emptyMembersSet));
+    manager.handleOrDeferViewEvent(new NetView(myMemberId, 3, viewmembers));
     assertEquals(4, manager.getStartupEvents().size());
     
     // add a surprise member that will be shunned due to it's having
@@ -263,7 +262,7 @@ public class GMSMembershipManagerJUnitTest {
     manager.isJoining = false;
     mockMembers[4].setVmViewId(4);
     viewmembers = Arrays.asList(new InternalDistributedMember[] {mockMembers[0], myMemberId,
surpriseMember2, mockMembers[4]});
-    manager.handleOrDeferViewEvent(new NetView(myMemberId, 4, viewmembers, emptyMembersSet,
emptyMembersSet));
+    manager.handleOrDeferViewEvent(new NetView(myMemberId, 4, viewmembers));
     assertEquals(6, manager.getStartupEvents().size());
     
     // exercise the toString methods for code coverage
@@ -286,7 +285,7 @@ public class GMSMembershipManagerJUnitTest {
     // event processing has started.  This should notify the distribution manager
     // with a LocalViewMessage to process the view
     reset(listener);
-    manager.handleOrDeferViewEvent(new NetView(myMemberId, 5, viewmembers, emptyMembersSet,
emptyMembersSet));
+    manager.handleOrDeferViewEvent(new NetView(myMemberId, 5, viewmembers));
     assertEquals(0, manager.getStartupEvents().size());
     verify(listener).messageReceived(isA(LocalViewMessage.class));
 
@@ -310,7 +309,7 @@ public class GMSMembershipManagerJUnitTest {
     
     manager.setDirectChannel(dc);
 
-    NetView view = new NetView(myMemberId, 1, members, emptyMembersSet, emptyMembersSet);
+    NetView view = new NetView(myMemberId, 1, members);
     manager.installView(view);
     when(joinLeave.getView()).thenReturn(view);
     
@@ -387,7 +386,7 @@ public class GMSMembershipManagerJUnitTest {
     manager.isJoining = true;
 
     List<InternalDistributedMember> viewmembers = Arrays.asList(new InternalDistributedMember[]
{mockMembers[0], mockMembers[1], myMemberId});
-    manager.installView(new NetView(myMemberId, 2, viewmembers, emptyMembersSet, emptyMembersSet));
+    manager.installView(new NetView(myMemberId, 2, viewmembers));
     
     InternalDistributedMember[] destinations = new InternalDistributedMember[viewmembers.size()];
     for (int i=0; i<destinations.length; i++) {
@@ -422,7 +421,7 @@ public class GMSMembershipManagerJUnitTest {
     manager.isJoining = true;
 
     List<InternalDistributedMember> viewmembers = Arrays.asList(new InternalDistributedMember[]
{mockMembers[0], mockMembers[1], myMemberId});
-    manager.installView(new NetView(myMemberId, 2, viewmembers, emptyMembersSet, emptyMembersSet));
+    manager.installView(new NetView(myMemberId, 2, viewmembers));
 
     List<InternalDistributedMember> mbrs = new ArrayList<>(1);
     mbrs.add(mockMembers[0]);


Mime
View raw message