geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jche...@apache.org
Subject incubator-geode git commit: GEODE-1039 CI Failure GMSHealthMonitorJUnitTest.testCheckIfAvailableWithSimulatedHeartBeatWithTcpCheck
Date Fri, 11 Mar 2016 17:43:10 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 9fdcca129 -> 87b4eba3f


GEODE-1039 CI Failure GMSHealthMonitorJUnitTest.testCheckIfAvailableWithSimulatedHeartBeatWithTcpCheck


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

Branch: refs/heads/develop
Commit: 87b4eba3f92b55f2aec8eed39bdc974bc0906ca5
Parents: 9fdcca1
Author: Jianxia Chen <jchen@pivotal.io>
Authored: Fri Mar 11 09:42:22 2016 -0800
Committer: Jianxia Chen <jchen@pivotal.io>
Committed: Fri Mar 11 09:42:22 2016 -0800

----------------------------------------------------------------------
 .../membership/gms/fd/GMSHealthMonitor.java     |  2 +-
 .../gms/fd/GMSHealthMonitorJUnitTest.java       | 20 ++++++++------------
 2 files changed, 9 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/87b4eba3/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
index 536e26e..82eb0b0 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
@@ -1278,7 +1278,7 @@ public class GMSHealthMonitor implements HealthMonitor, MessageHandler
{
   
       if (!pinged && !isStopping) {
         TimeStamp ts = memberTimeStamps.get(mbr);
-        if (ts == null || ts.getTime() <= startTime) {
+        if (ts == null || ts.getTime() < startTime) {
           logger.info("Final check failed - requesting removal of suspect member " + mbr);
           if (initiateRemoval) {
             services.getJoinLeave().remove(mbr, reason);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/87b4eba3/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java
index a96b546..9324783 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java
@@ -175,7 +175,7 @@ public class GMSHealthMonitorJUnitTest {
 
     // allow the monitor to give up on the initial "next neighbor" and
     // move on to the one after it
-    long giveup = System.currentTimeMillis() + memberTimeout + 500;
+    long giveup = System.currentTimeMillis() + memberTimeout + 1500;
     InternalDistributedMember expected = mockMembers.get(5);
     InternalDistributedMember neighbor = gmsHealthMonitor.getNextNeighbor();
     while (System.currentTimeMillis() < giveup && neighbor != expected) {
@@ -230,7 +230,7 @@ public class GMSHealthMonitorJUnitTest {
   }
 
   private NetView installAView() {
-    System.out.println("testSuspectMembersCalledThroughMemberCheckThread starting");
+    System.out.println("installAView starting");
     NetView v = new NetView(mockMembers.get(0), 2, mockMembers);
 
     // 3rd is current member
@@ -445,6 +445,7 @@ public class GMSHealthMonitorJUnitTest {
   
   @Test
   public void testCheckIfAvailableWithSimulatedHeartBeatWithTcpCheck() {
+    System.out.println("testCheckIfAvailableWithSimulatedHeartBeatWithTcpCheck");
     useGMSHealthMonitorTestClass = true;
     
     try {
@@ -453,15 +454,6 @@ public class GMSHealthMonitorJUnitTest {
       setFailureDetectionPorts(v);
       
       InternalDistributedMember memberToCheck = mockMembers.get(1);
-      HeartbeatMessage fakeHeartbeat = new HeartbeatMessage();
-      fakeHeartbeat.setSender(memberToCheck);
-      when(messenger.send(any(HeartbeatRequestMessage.class))).then(new Answer() {
-        @Override
-        public Object answer(InvocationOnMock invocation) throws Throwable {
-          gmsHealthMonitor.processMessage(fakeHeartbeat);
-          return null;
-        }
-      });
       
       boolean retVal = gmsHealthMonitor.checkIfAvailable(memberToCheck, "Not responding",
true);
       assertTrue("CheckIfAvailable should have return true", retVal);
@@ -677,8 +669,12 @@ public class GMSHealthMonitorJUnitTest {
   public class GMSHealthMonitorTest extends GMSHealthMonitor {
     @Override
     boolean doTCPCheckMember(InternalDistributedMember suspectMember, int port) {
-      if(useGMSHealthMonitorTestClass)
+      if(useGMSHealthMonitorTestClass) {       
+        HeartbeatMessage fakeHeartbeat = new HeartbeatMessage();
+        fakeHeartbeat.setSender(suspectMember);
+        gmsHealthMonitor.processMessage(fakeHeartbeat);                
         return false;
+      }
       return super.doTCPCheckMember(suspectMember, port);
     }
   }


Mime
View raw message