TaskSpec rebaseTaskSpecTime(TaskSpec spec) throws Exception {
        ObjectNode node = JsonUtil.JSON_SERDE.valueToTree(spec);
        node.set("startMs", new LongNode(Math.max(time.milliseconds(), spec.startMs())));
        return JsonUtil.JSON_SERDE.treeToValue(node, TaskSpec.class);
    }
@Test
    public void testAgentExecWithNormalExit() throws Exception {
        Agent agent = createAgent(Scheduler.SYSTEM);
        SampleTaskSpec spec = new SampleTaskSpec(0, 120000,
            Collections.singletonMap("node01", 1L), "");
        TaskSpec rebasedSpec = agent.rebaseTaskSpecTime(spec);
        testExec(agent,
            String.format("Waiting for completion of task:%s%n",
                JsonUtil.toPrettyJsonString(rebasedSpec)) +
                String.format("Task succeeded with status \"halted\"%n"),
            true, rebasedSpec);
    }