Search in sources :

Example 1 with StoreEvent

use of com.netflix.titus.master.jobmanager.service.integration.scenario.StubbedJobStore.StoreEvent in project titus-control-plane by Netflix.

the class JobScenarioBuilder method expectTaskEvent.

private Task expectTaskEvent(int taskIdx, int resubmit, StoreEvent eventType) {
    Task lastInStore = autoAdvance(() -> eventType == StoreEvent.TaskRemoved ? jobStore.expectTaskInStoreArchive(jobId, taskIdx, resubmit) : jobStore.expectTaskInStore(jobId, taskIdx, resubmit));
    Pair<StoreEvent, Task> storeEventPair = storeEventsSubscriber.takeNextTaskStoreEvent(taskIdx, resubmit);
    assertThat(storeEventPair.getLeft()).isEqualTo(eventType);
    Task task = storeEventPair.getRight();
    assertThat(task.getId()).describedAs("Task version in store different from the task in the store event: %s != %s", lastInStore.getId(), task.getId()).isEqualTo(lastInStore.getId());
    return task;
}
Also used : Task(com.netflix.titus.api.jobmanager.model.job.Task) BatchJobTask(com.netflix.titus.api.jobmanager.model.job.BatchJobTask) StoreEvent(com.netflix.titus.master.jobmanager.service.integration.scenario.StubbedJobStore.StoreEvent)

Aggregations

BatchJobTask (com.netflix.titus.api.jobmanager.model.job.BatchJobTask)1 Task (com.netflix.titus.api.jobmanager.model.job.Task)1 StoreEvent (com.netflix.titus.master.jobmanager.service.integration.scenario.StubbedJobStore.StoreEvent)1