use of com.netflix.titus.master.jobmanager.service.integration.scenario.JobScenarioBuilder in project titus-control-plane by Netflix.
the class MoveTaskTest method testMoveTimeout.
@Test
public void testMoveTimeout() {
JobDescriptor<ServiceJobExt> jobDescriptor = oneTaskServiceJobDescriptor();
JobScenarioBuilder sourceJobBuilder = startNewJob(jobDescriptor);
String sourceJobId = sourceJobBuilder.getJobId();
String targetJobId = startNewJob(jobDescriptor).getJobId();
sourceJobBuilder.advance().slowStore().inTask(0, 0, task -> {
ExtTestSubscriber<Void> testSubscriber = new ExtTestSubscriber<>();
jobsScenarioBuilder.getJobOperations().moveServiceTask(sourceJobId, targetJobId, task.getId(), callMetadata).timeout(1, TimeUnit.SECONDS, testScheduler).subscribe(testSubscriber);
testScheduler.advanceTimeBy(2, TimeUnit.SECONDS);
assertThat(testSubscriber.isError()).isTrue();
assertThat(testSubscriber.getError()).isInstanceOf(TimeoutException.class);
});
}
use of com.netflix.titus.master.jobmanager.service.integration.scenario.JobScenarioBuilder in project titus-control-plane by Netflix.
the class TaskRetryPolicyTest method failRetryableTask.
private void failRetryableTask(int[] delays, TimeUnit timeUnit, int retries) {
JobScenarioBuilder jobScenario = jobsScenarioBuilder.getJobScenario(0);
for (int i = 0; i < retries; i++) {
int retryDelay = delays[i];
jobScenario.template(ScenarioTemplates.failRetryableTask(0, i, timeUnit.toMillis(retryDelay)));
}
}
Aggregations