org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor.ExitCode Java Examples

The following examples show how to use org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor.ExitCode. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestContainer.java    From hadoop with Apache License 2.0 6 votes vote down vote up
@Test
@SuppressWarnings("unchecked") // mocked generic
public void testCleanupOnFailure() throws Exception {
  WrappedContainer wc = null;
  try {
    wc = new WrappedContainer(10, 314159265358979L, 4344, "yak");
    wc.initContainer();
    wc.localizeResources();
    wc.launchContainer();
    reset(wc.localizerBus);
    wc.containerFailed(ExitCode.FORCE_KILLED.getExitCode());
    assertEquals(ContainerState.EXITED_WITH_FAILURE, 
        wc.c.getContainerState());
    assertNull(wc.c.getLocalizedResources());
    verifyCleanupCall(wc);
  }
  finally {
    if (wc != null) {
      wc.finished();
    }
  } 
}
 
Example #2
Source File: TestContainer.java    From big-c with Apache License 2.0 6 votes vote down vote up
@Test
@SuppressWarnings("unchecked") // mocked generic
public void testCleanupOnFailure() throws Exception {
  WrappedContainer wc = null;
  try {
    wc = new WrappedContainer(10, 314159265358979L, 4344, "yak");
    wc.initContainer();
    wc.localizeResources();
    wc.launchContainer();
    reset(wc.localizerBus);
    wc.containerFailed(ExitCode.FORCE_KILLED.getExitCode());
    assertEquals(ContainerState.EXITED_WITH_FAILURE, 
        wc.c.getContainerState());
    assertNull(wc.c.getLocalizedResources());
    verifyCleanupCall(wc);
  }
  finally {
    if (wc != null) {
      wc.finished();
    }
  } 
}