@Test
    public void testProcessStop() throws Exception {
        if (OperatingSystem.IS_WINDOWS) return;
        ExternalCommandWorker worker =
            new ExternalCommandWorkerBuilder("testStopTask").
                command("sleep", "3600000").build();
        KafkaFutureImpl<String> doneFuture = new KafkaFutureImpl<>();
        worker.start(null, new AgentWorkerStatusTracker(), doneFuture);
        worker.stop(null);
        // We don't check the numeric return code, since that will vary based on
        // platform.
        assertTrue(doneFuture.get().startsWith("exited with return code "));
    }
Test running a process which times out.  We will send it a SIGTERM.
trogdor/src/test/java/org/apache/kafka/trogdor/workload/ExternalCommandWorkerTest.java