|
@@ -398,6 +398,8 @@ public class TestNMClient {
|
|
|
"will be Rolled-back", Arrays.asList(new Integer[] {-1000}));
|
|
|
testCommitContainer(container.getId(), true);
|
|
|
testReInitializeContainer(container.getId(), clc, false);
|
|
|
+ testGetContainerStatus(container, i, ContainerState.RUNNING,
|
|
|
+ "will be Re-initialized", Arrays.asList(new Integer[] {-1000}));
|
|
|
testCommitContainer(container.getId(), false);
|
|
|
} else {
|
|
|
testReInitializeContainer(container.getId(), clc, true);
|
|
@@ -449,24 +451,21 @@ public class TestNMClient {
|
|
|
ContainerState state, String diagnostics, List<Integer> exitStatuses)
|
|
|
throws YarnException, IOException {
|
|
|
while (true) {
|
|
|
- try {
|
|
|
- ContainerStatus status = nmClient.getContainerStatus(
|
|
|
- container.getId(), container.getNodeId());
|
|
|
- // NodeManager may still need some time to get the stable
|
|
|
- // container status
|
|
|
- if (status.getState() == state) {
|
|
|
- assertEquals(container.getId(), status.getContainerId());
|
|
|
- assertTrue("" + index + ": " + status.getDiagnostics(),
|
|
|
- status.getDiagnostics().contains(diagnostics));
|
|
|
-
|
|
|
- assertTrue("Exit Statuses are supposed to be in: " + exitStatuses +
|
|
|
- ", but the actual exit status code is: " + status.getExitStatus(),
|
|
|
- exitStatuses.contains(status.getExitStatus()));
|
|
|
- break;
|
|
|
- }
|
|
|
- Thread.sleep(100);
|
|
|
- } catch (InterruptedException e) {
|
|
|
- e.printStackTrace();
|
|
|
+ sleep(250);
|
|
|
+ ContainerStatus status = nmClient.getContainerStatus(
|
|
|
+ container.getId(), container.getNodeId());
|
|
|
+ // NodeManager may still need some time to get the stable
|
|
|
+ // container status
|
|
|
+ if (status.getState() == state) {
|
|
|
+ assertEquals(container.getId(), status.getContainerId());
|
|
|
+ assertTrue("" + index + ": " + status.getDiagnostics(),
|
|
|
+ status.getDiagnostics().contains(diagnostics));
|
|
|
+
|
|
|
+ assertTrue("Exit Statuses are supposed to be in: " + exitStatuses +
|
|
|
+ ", but the actual exit status code is: " +
|
|
|
+ status.getExitStatus(),
|
|
|
+ exitStatuses.contains(status.getExitStatus()));
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -559,9 +558,7 @@ public class TestNMClient {
|
|
|
ContainerLaunchContext clc, boolean autoCommit)
|
|
|
throws YarnException, IOException {
|
|
|
try {
|
|
|
- sleep(250);
|
|
|
nmClient.reInitializeContainer(containerId, clc, autoCommit);
|
|
|
- sleep(250);
|
|
|
} catch (YarnException e) {
|
|
|
// NM container will only be in SCHEDULED state, so expect the increase
|
|
|
// action to fail.
|