@Test
public void testWaitingProcessFailure() throws Exception {

    TestCB cb = new TestCB() {
        int i = 4;
        @Override
        protected Action process() {
            processed++;
            if (i-- > 1) {
                scheduler.schedule(i > 2 ? successTask : failTask, 50, TimeUnit.MILLISECONDS);
                return Action.SCHEDULED;
            }
            return Action.SUCCEEDED;
        }
    };
    cb.iterate();
    assertFalse(cb.waitForComplete());
    assertEquals(2, cb.processed);
}