### Question:
LinuxContainerExecutor extends ContainerExecutor { @Override public boolean signalContainer(String user, String pid, Signal signal) throws IOException { String[] command = new String[] { containerExecutorExe, user, Integer.toString(Commands.SIGNAL_CONTAINER.getValue()), pid, Integer.toString(signal.getValue()) }; ShellCommandExecutor shExec = new ShellCommandExecutor(command); if (LOG.isDebugEnabled()) { LOG.debug("signalContainer: " + Arrays.toString(command)); } try { shExec.execute(); } catch (ExitCodeException e) { int ret_code = shExec.getExitCode(); if (ret_code == ResultCode.INVALID_CONTAINER_PID.getValue()) { return false; } logOutput(shExec.getOutput()); throw new IOException("Problem signalling container " + pid + " with " + signal + "; exit = " + ret_code); } return true; }  @Override void setConf(Configuration conf); @Override void init(); @Override void startLocalizer(Path nmPrivateContainerTokensPath,
      InetSocketAddress nmAddr, String user, String appId, String locId,
      List<String> localDirs, List<String> logDirs); @Override int launchContainer(Container container,
      Path nmPrivateCotainerScriptPath, Path nmPrivateTokensPath,
      String user, String appId, Path containerWorkDir,
      List<String> localDirs, List<String> logDirs); @Override boolean signalContainer(String user, String pid, Signal signal); @Override void deleteAsUser(String user, Path dir, Path... baseDirs);  }### Answer:
@Test public void testContainerKill() throws Exception { if (!shouldRun()) { return; } final ContainerId sleepId = getNextContainerId(); Thread t = new Thread() { public void run() { try { runAndBlock(sleepId, "sleep", "100"); } catch (IOException e) { LOG.warn("Caught exception while running sleep",e); } }; }; t.setDaemon(true); t.start(); assertTrue(t.isAlive()); String pid = null; int count = 10; while ((pid = exec.getProcessId(sleepId)) == null && count > 0) { LOG.info("Sleeping for 200 ms before checking for pid "); Thread.sleep(200); count--; } assertNotNull(pid); LOG.info("Going to killing the process."); exec.signalContainer(appSubmitter, pid, Signal.TERM); LOG.info("sleeping for 100ms to let the sleep be killed"); Thread.sleep(100); assertFalse(t.isAlive()); }