YARN-2398. TestResourceTrackerOnHA crashes. Contributed by Ajith S.
(cherry picked from commit 666ad0b67b
)
This commit is contained in:
parent
f1d5a95cf3
commit
05b384271c
|
@ -328,7 +328,7 @@ public abstract class ProtocolHATestBase extends ClientBaseWithFixes {
|
||||||
private boolean waittingForFailOver() {
|
private boolean waittingForFailOver() {
|
||||||
int maximumWaittingTime = 50;
|
int maximumWaittingTime = 50;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
while (!failoverTriggered.get() && count >= maximumWaittingTime) {
|
while (!failoverTriggered.get() && count <= maximumWaittingTime) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(100);
|
Thread.sleep(100);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
@ -336,7 +336,7 @@ public abstract class ProtocolHATestBase extends ClientBaseWithFixes {
|
||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
if (count >= maximumWaittingTime) {
|
if (count >= maximumWaittingTime && failoverThread != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue