@Test
    public void testAgentGetUptime() throws Exception {
        MockTime time = new MockTime(0, 111, 0);
        MockScheduler scheduler = new MockScheduler(time);
        Agent agent = createAgent(scheduler);
        AgentClient client = new AgentClient.Builder().
            maxTries(10).target("localhost", agent.port()).build();

        UptimeResponse uptime = client.uptime();
        assertEquals(agent.uptime(), uptime);

        time.setCurrentTimeMs(150);
        assertNotEquals(agent.uptime(), uptime);
    }
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