You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2015/12/12 17:24:27 UTC
ambari git commit: AMBARI-14305. Ambari Server Unit Test failure on
trunk and branch-2.2
(TestHeartbeatMonitor/testHeartbeatStateCommandsEnqueueing) (aonishuk)
Repository: ambari
Updated Branches:
refs/heads/branch-2.2 99459f468 -> 9e1ebd768
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/9e1ebd76
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9e1ebd76
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9e1ebd76
Branch: refs/heads/branch-2.2
Commit: 9e1ebd76887568e326ce7e326a1f3b4bc4509260
Parents: 99459f4
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Sat Dec 12 18:24:21 2015 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Sat Dec 12 18:24:21 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/9e1ebd76/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