@Test
public void testTimeout() throws Exception {

    ScheduleReference reference = localScheduler.scheduleMono(
            scheduleDescriptor.toBuilder().withName("testTimeout").build(),
            tick -> Mono.never(),
            Schedulers.parallel()
    );
    expectScheduleAdded(reference);
    expectScheduleUpdateEvent(SchedulingState.Running);
    expectScheduleUpdateEvent(SchedulingState.Failed);
    // Replacement
    expectScheduleUpdateEvent(SchedulingState.Waiting);
    assertThat(reference.getSchedule().getCompletedActions()).hasSize(1);
    ScheduledAction failedAction = reference.getSchedule().getCompletedActions().get(0);
    assertThat(failedAction.getStatus().getState()).isEqualTo(SchedulingState.Failed);
    assertThat(failedAction.getStatus().getError().get()).isInstanceOf(TimeoutException.class);
}