@SuppressFBWarnings("SIC_INNER_SHOULD_BE_STATIC_ANON")
@Test(expected = CancellationException.class, timeout = 30000)
  @ExpectLog(level = Level.ERROR, category = "org.spf4j.os", nrTimes = 2)
public void testExitCode5() throws InterruptedException, ExecutionException, TimeoutException {

  final CountDownLatch latch = new CountDownLatch(1);
  final CountDownLatch canCancel = new CountDownLatch(1);
  Future<?> submit = DefaultExecutor.INSTANCE.submit(new AbstractRunnable() {
    @Override
    public void doRun() throws IOException, InterruptedException, ExecutionException, TimeoutException {
      try {
        canCancel.countDown();
        Runtime.jrun(RuntimeTest.TestError3.class, 10000);
      } catch (InterruptedException ex) {
        LOG.info("Interrupted jrun TestError3", ex);
        latch.countDown();
      } catch (Exception ex) {
        LOG.info("Exception jrun TestError3", ex);
      }
    }
  });
  if (!canCancel.await(3000, TimeUnit.MILLISECONDS)) {
    Assert.fail("exec should happen");
  }
  LOG.debug("cancelling {}", submit);
  submit.cancel(true);
  if (!latch.await(1, TimeUnit.SECONDS)) {
    Assert.fail("exec should be cancelled");
  }
  submit.get(10000, TimeUnit.MILLISECONDS);
}