YARN-2977. Fixed intermittent TestNMClient failure. (Contributed by Junping Du)

This commit is contained in:
Tsuyoshi Ozawa 2014-12-20 22:43:47 +09:00
parent 0a5b28605f
commit 31753da961
1 changed files with 7 additions and 3 deletions

View File

@ -344,10 +344,11 @@ public class TestNMClient {
// getContainerStatus can be called after stopContainer // getContainerStatus can be called after stopContainer
try { try {
// O is possible if CLEANUP_CONTAINER is executed too late // O is possible if CLEANUP_CONTAINER is executed too late
// 137 is possible if the container is not terminated but killed // -105 is possible if the container is not terminated but killed
testGetContainerStatus(container, i, ContainerState.COMPLETE, testGetContainerStatus(container, i, ContainerState.COMPLETE,
"Container killed by the ApplicationMaster.", Arrays.asList( "Container killed by the ApplicationMaster.", Arrays.asList(
new Integer[] {ContainerExitStatus.KILLED_BY_APPMASTER})); new Integer[] {ContainerExitStatus.KILLED_BY_APPMASTER,
ContainerExitStatus.SUCCESS}));
} catch (YarnException e) { } catch (YarnException e) {
// The exception is possible because, after the container is stopped, // The exception is possible because, after the container is stopped,
// it may be removed from NM's context. // it may be removed from NM's context.
@ -383,7 +384,10 @@ public class TestNMClient {
assertEquals(container.getId(), status.getContainerId()); assertEquals(container.getId(), status.getContainerId());
assertTrue("" + index + ": " + status.getDiagnostics(), assertTrue("" + index + ": " + status.getDiagnostics(),
status.getDiagnostics().contains(diagnostics)); status.getDiagnostics().contains(diagnostics));
assertTrue(exitStatuses.contains(status.getExitStatus()));
assertTrue("Exit Statuses are supposed to be in: " + exitStatuses +
", but the actual exit status code is: " + status.getExitStatus(),
exitStatuses.contains(status.getExitStatus()));
break; break;
} }
Thread.sleep(100); Thread.sleep(100);