fixed GEODE-767: GMSJoinLeaveJUnitTest.testNoViewAckCausesRemovalMessage

The test was not waiting for background suspect processing to take place
and had a faulty verification check.


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

Branch: refs/heads/feature/GEODE-217
Commit: 5dffe257c82ddd56c6726c33903b9a4b75fc5754
Parents: f90f139
Author: Bruce Schuchardt <bschucha...@pivotal.io>
Authored: Fri Jan 8 15:35:44 2016 -0800
Committer: Bruce Schuchardt <bschucha...@pivotal.io>
Committed: Fri Jan 8 15:37:19 2016 -0800

----------------------------------------------------------------------
 .../membership/gms/membership/GMSJoinLeaveJUnitTest.java      | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/5dffe257/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 05b0996..f0d6982 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
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.isA;
+import static org.mockito.Mockito.atLeast;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.times;
@@ -49,6 +50,7 @@ import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 import org.mockito.verification.Timeout;
 
+import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import 
com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.distributed.internal.membership.NetView;
@@ -739,7 +741,10 @@ public class GMSJoinLeaveJUnitTest {
       Thread.sleep(1000);
     }
     assertTrue(gmsJoinLeave.isCoordinator());
-    verify(messenger, times(2)).send(any(RemoveMemberMessage.class));
+    // wait for suspect processing
+    Thread.sleep(10000);
+    verify(healthMonitor, 
atLeast(1)).checkIfAvailable(isA(DistributedMember.class), isA(String.class), 
isA(Boolean.class));
+//    verify(messenger, atLeast(1)).send(isA(RemoveMemberMessage.class));
   }
 
   /**

Reply via email to