use of com.netflix.titus.common.framework.scheduler.model.Schedule in project titus-control-plane by Netflix.
the class LocalSchedulerTransactionLoggerTest method testDoFormatScheduleFailureUpdate.
@Test
public void testDoFormatScheduleFailureUpdate() {
Schedule schedule = updateStatus(REFERENCE_SCHEDULE, newSchedulingStatus(SchedulingState.Failed));
verify(LocalSchedulerTransactionLogger.doFormat(new ScheduleUpdateEvent(schedule)));
}
use of com.netflix.titus.common.framework.scheduler.model.Schedule in project titus-control-plane by Netflix.
the class LocalSchedulerTransactionLoggerTest method testDoFormatScheduleSuccessUpdate.
@Test
public void testDoFormatScheduleSuccessUpdate() {
Schedule schedule = updateStatus(REFERENCE_SCHEDULE, newSchedulingStatus(SchedulingState.Succeeded));
verify(LocalSchedulerTransactionLogger.doFormat(new ScheduleUpdateEvent(schedule)));
}
use of com.netflix.titus.common.framework.scheduler.model.Schedule in project titus-control-plane by Netflix.
the class DefaultLocalSchedulerTest method expectScheduleRemoved.
private void expectScheduleRemoved(ScheduleReference reference) throws InterruptedException {
assertThat(reference.isClosed()).isTrue();
LocalSchedulerEvent removedEvent = eventSubscriber.takeUntil(e -> e instanceof ScheduleRemovedEvent, Duration.ofSeconds(5));
Schedule schedule = removedEvent.getSchedule();
assertThat(schedule.getCurrentAction().getStatus().getState().isFinal()).isTrue();
assertThat(localScheduler.getArchivedSchedules()).hasSize(1);
assertThat(localScheduler.getArchivedSchedules().get(0).getId()).isEqualTo(reference.getSchedule().getId());
}
use of com.netflix.titus.common.framework.scheduler.model.Schedule in project titus-control-plane by Netflix.
the class LocalSchedulerTransactionLoggerTest method testDoFormatScheduleRunningUpdate.
@Test
public void testDoFormatScheduleRunningUpdate() {
Schedule schedule = updateStatus(REFERENCE_SCHEDULE, newSchedulingStatus(SchedulingState.Running));
verify(LocalSchedulerTransactionLogger.doFormat(new ScheduleUpdateEvent(schedule)));
}
use of com.netflix.titus.common.framework.scheduler.model.Schedule in project titus-control-plane by Netflix.
the class LocalSchedulerTransactionLoggerTest method testDoFormatNewAction.
@Test
public void testDoFormatNewAction() {
Schedule firstCompleted = updateStatus(REFERENCE_SCHEDULE, newSchedulingStatus(SchedulingState.Succeeded));
Schedule nextAction = firstCompleted.toBuilder().withCurrentAction(ScheduledAction.newBuilder().withId("reference").withStatus(newSchedulingStatus(SchedulingState.Waiting)).withIteration(ExecutionId.initial()).build()).withCompletedActions(Collections.singletonList(firstCompleted.getCurrentAction())).build();
verify(LocalSchedulerTransactionLogger.doFormat(new ScheduleUpdateEvent(nextAction)));
}
Aggregations