}
}).start();
barrier.await(Timeout.standardTimeoutMillis(), TimeUnit.MILLISECONDS);
Thread.sleep(Timeout.standardTimeoutMillis());
// Watchdog should have run while the thread is alive, but not executing anything
assertTrue(watchdog.areThreadsAlive());
barrier.await(Timeout.standardTimeoutMillis(), TimeUnit.MILLISECONDS);
Thread.sleep(Timeout.standardTimeoutMillis());
// Watchdog should have run with the thread dead
assertFalse(watchdog.areThreadsAlive());
} finally {