private static void sleepAtMost(final int duration) throws InterruptedException {
    StopWatch stopWatch = new StopWatch(true);
    while (stopWatch.elapsedTimeMillis() < duration) {
      Thread.sleep(1000);
    }
  }
Additional time for launched processes to live before terminating
geode-junit/src/main/java/org/apache/geode/internal/process/AbstractProcessStreamReaderIntegrationTest.java