Search in sources :

Example 1 with Schedule

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)));
}
Also used : Schedule(com.netflix.titus.common.framework.scheduler.model.Schedule) ScheduleUpdateEvent(com.netflix.titus.common.framework.scheduler.model.event.ScheduleUpdateEvent) Test(org.junit.Test)

Example 2 with 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)));
}
Also used : Schedule(com.netflix.titus.common.framework.scheduler.model.Schedule) ScheduleUpdateEvent(com.netflix.titus.common.framework.scheduler.model.event.ScheduleUpdateEvent) Test(org.junit.Test)

Example 3 with 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());
}
Also used : ScheduleRemovedEvent(com.netflix.titus.common.framework.scheduler.model.event.ScheduleRemovedEvent) LocalSchedulerEvent(com.netflix.titus.common.framework.scheduler.model.event.LocalSchedulerEvent) Schedule(com.netflix.titus.common.framework.scheduler.model.Schedule)

Example 4 with Schedule

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)));
}
Also used : Schedule(com.netflix.titus.common.framework.scheduler.model.Schedule) ScheduleUpdateEvent(com.netflix.titus.common.framework.scheduler.model.event.ScheduleUpdateEvent) Test(org.junit.Test)

Example 5 with 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)));
}
Also used : Schedule(com.netflix.titus.common.framework.scheduler.model.Schedule) ScheduleUpdateEvent(com.netflix.titus.common.framework.scheduler.model.event.ScheduleUpdateEvent) Test(org.junit.Test)

Aggregations

Schedule (com.netflix.titus.common.framework.scheduler.model.Schedule)5 ScheduleUpdateEvent (com.netflix.titus.common.framework.scheduler.model.event.ScheduleUpdateEvent)4 Test (org.junit.Test)4 LocalSchedulerEvent (com.netflix.titus.common.framework.scheduler.model.event.LocalSchedulerEvent)1 ScheduleRemovedEvent (com.netflix.titus.common.framework.scheduler.model.event.ScheduleRemovedEvent)1