ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [1/2] ambari git commit: AMBARI-14305. Ambari Server Unit Test failure on trunk and branch-2.2 (TestHeartbeatMonitor/testHeartbeatStateCommandsEnqueueing) (aonishuk)
Date Sat, 12 Dec 2015 16:14:12 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 51e890416 -> 98a43319e
  refs/heads/trunk 46047accd -> 6944d61f0


AMBARI-14305. Ambari Server Unit Test failure on trunk and branch-2.2 (TestHeartbeatMonitor/testHeartbeatStateCommandsEnqueueing)
(aonishuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6944d61f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6944d61f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6944d61f

Branch: refs/heads/trunk
Commit: 6944d61f05cda5d4b47810bc4f835a2bb8e44016
Parents: 46047ac
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Sat Dec 12 18:14:03 2015 +0200
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Sat Dec 12 18:14:03 2015 +0200

----------------------------------------------------------------------
 .../ambari/server/agent/TestHeartbeatMonitor.java       | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6944d61f/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatMonitor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatMonitor.java
b/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatMonitor.java
index d3fee8b..9c59cde 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatMonitor.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatMonitor.java
@@ -370,9 +370,15 @@ public class TestHeartbeatMonitor {
     hm.start();
     Thread.sleep(3 * heartbeatMonitorWakeupIntervalMS);
     hm.shutdown();
-    hm.join(2*heartbeatMonitorWakeupIntervalMS);
-    if (hm.isAlive()) {
-      fail("HeartbeatMonitor should be already stopped");
+    
+    int tryNumber = 0;
+    while(hm.isAlive()) {
+      hm.join(2*heartbeatMonitorWakeupIntervalMS);
+      tryNumber++;
+      
+      if(tryNumber >= 5) {
+        fail("HeartbeatMonitor should be already stopped");
+      }
     }
     verify(aqMock, atLeast(2)).enqueue(eq(hostname1), commandCaptor.capture());  // After
registration and by HeartbeatMonitor
 


Mime
View raw message