@Test
    public void testProcessWithFailedExit() throws Exception {
        if (OperatingSystem.IS_WINDOWS) return;
        ExternalCommandWorker worker =
            new ExternalCommandWorkerBuilder("falseTask").command("false").build();
        KafkaFutureImpl<String> doneFuture = new KafkaFutureImpl<>();
        worker.start(null, new AgentWorkerStatusTracker(), doneFuture);
        assertEquals("exited with return code 1", doneFuture.get());
        worker.stop(null);
    }
Test running a process which exits unsuccessfully-- in this case, /bin/false.
trogdor/src/test/java/org/apache/kafka/trogdor/workload/ExternalCommandWorkerTest.java