use of com.netflix.titus.grpc.protogen.TaskRelocationStatus in project titus-control-plane by Netflix.
the class TaskRelocationIntegrationTest method testPlannedRelocation.
@Test(timeout = 60_000)
public void testPlannedRelocation() throws Exception {
Task task = createAndPlaceOneTaskJob(TestDataFactory.REMOVABLE_INSTANCE_GROUP_ID);
relocationConnectorStubs.setQuota(task.getJobId(), 1);
// Get the plan
TaskRelocationPlan plan = doTry(() -> findRelocationPlan(task.getId()));
assertThat(plan.getTaskId()).isEqualTo(task.getId());
assertThat(plan.getReasonCode()).isEqualTo(TaskRelocationReason.SelfManagedMigration.name());
assertThat(plan.getRelocationTime()).isLessThanOrEqualTo(clock.wallTime() + RELOCATION_TIME_MS);
// Wait for the relocation
TaskRelocationStatus status = doTry(() -> findRelocationStatus(task.getId()));
assertThat(status.getState()).isEqualTo(TaskRelocationStatus.TaskRelocationState.Success);
assertThat(status.getStatusCode()).isEqualTo(com.netflix.titus.api.relocation.model.TaskRelocationStatus.STATUS_CODE_TERMINATED);
assertThat(status.getStatusMessage()).isNotEmpty();
}
Aggregations