@Test
    public void testAgentExecWithTimeout() throws Exception {
        Agent agent = createAgent(Scheduler.SYSTEM);
        NoOpTaskSpec spec = new NoOpTaskSpec(0, 1);
        TaskSpec rebasedSpec = agent.rebaseTaskSpecTime(spec);
        testExec(agent,
            String.format("Waiting for completion of task:%s%n",
                JsonUtil.toPrettyJsonString(rebasedSpec)) +
            String.format("Task failed with status null and error worker expired%n"),
            false, rebasedSpec);
    }
Modify sleep() to call super.sleep() every second call
in order to avoid the endless loop in the tick() calls to the MockScheduler listener
trogdor/src/test/java/org/apache/kafka/trogdor/agent/AgentTest.java