YARN-5927. BaseContainerManagerTest::waitForNMContainerState timeout accounting is not accurate. (Kai Sasaki via kasha)

This commit is contained in:
Karthik Kambatla 2017-08-11 12:14:06 -07:00
parent 07fff43f4a
commit 8c4b6d16a5
1 changed files with 5 additions and 5 deletions

View File

@ -310,13 +310,13 @@ public abstract class BaseContainerManagerTest {
new HashSet<>(finalStates);
int timeoutSecs = 0;
do {
Thread.sleep(2000);
Thread.sleep(1000);
containerStatus =
containerManager.getContainerStatuses(request)
.getContainerStatuses().get(0);
LOG.info("Waiting for container to get into one of states " + fStates
+ ". Current state is " + containerStatus.getState());
timeoutSecs += 2;
timeoutSecs += 1;
} while (!fStates.contains(containerStatus.getState())
&& timeoutSecs < timeOutMax);
LOG.info("Container state is " + containerStatus.getState());
@ -371,7 +371,7 @@ public abstract class BaseContainerManagerTest {
.containermanager.container.ContainerState currentState = null;
int timeoutSecs = 0;
do {
Thread.sleep(2000);
Thread.sleep(1000);
container =
containerManager.getContext().getContainers().get(containerID);
if (container != null) {
@ -381,9 +381,9 @@ public abstract class BaseContainerManagerTest {
LOG.info("Waiting for NM container to get into one of the following " +
"states: " + finalStates + ". Current state is " + currentState);
}
timeoutSecs += 2;
timeoutSecs += 1;
} while (!finalStates.contains(currentState)
&& timeoutSecs++ < timeOutMax);
&& timeoutSecs < timeOutMax);
LOG.info("Container state is " + currentState);
Assert.assertTrue("ContainerState is not correct (timedout)",
finalStates.contains(currentState));