From 666ad0b67b9162860fccddbd1d89c806c70b60ef Mon Sep 17 00:00:00 2001 From: Rohith Sharma K S Date: Thu, 11 Aug 2016 11:27:00 +0530 Subject: [PATCH] YARN-2398. TestResourceTrackerOnHA crashes. Contributed by Ajith S. --- .../org/apache/hadoop/yarn/client/ProtocolHATestBase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/ProtocolHATestBase.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/ProtocolHATestBase.java index f336b0f052..a8e91323a3 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/ProtocolHATestBase.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/ProtocolHATestBase.java @@ -328,7 +328,7 @@ public void resetFailoverTriggeredFlag(boolean flag) { private boolean waittingForFailOver() { int maximumWaittingTime = 50; int count = 0; - while (!failoverTriggered.get() && count >= maximumWaittingTime) { + while (!failoverTriggered.get() && count <= maximumWaittingTime) { try { Thread.sleep(100); } catch (InterruptedException e) { @@ -336,7 +336,7 @@ private boolean waittingForFailOver() { } count++; } - if (count >= maximumWaittingTime) { + if (count >= maximumWaittingTime && failoverThread != null) { return false; } try {