use of com.netflix.titus.master.integration.v3.scenario.JobsScenarioBuilder in project titus-control-plane by Netflix.
the class V3JobSchedulingAndRebootTest method submitBatchJobAndRebootTitusMaster.
@Test(timeout = LONG_TEST_TIMEOUT_MS)
public void submitBatchJobAndRebootTitusMaster() {
jobsScenarioBuilder.schedule(ONE_TASK_BATCH_JOB, jobScenarioBuilder -> jobScenarioBuilder.template(ScenarioTemplates.startTasksInNewJob()));
jobsScenarioBuilder.stop();
titusStackResource.getMaster().reboot();
JobsScenarioBuilder newJobsScenarioBuilder = new JobsScenarioBuilder(titusStackResource.getOperations());
newJobsScenarioBuilder.assertJobs(jobs -> jobs.size() == 1).takeJob(0).assertJob(JobAsserts.jobInState(JobState.Accepted)).assertTasks(tasks -> tasks.size() == 1);
}
use of com.netflix.titus.master.integration.v3.scenario.JobsScenarioBuilder in project titus-control-plane by Netflix.
the class JobsScenarioBuilder method schedule.
public JobsScenarioBuilder schedule(JobDescriptor<?> jobDescriptor, int times, Function<JobScenarioBuilder, JobScenarioBuilder> jobScenario) throws Exception {
String sequence = jobDescriptor.getJobGroupInfo().getSequence();
for (int i = 0; i < times; i++) {
int finalI = i;
JobDescriptor effective = sequence.isEmpty() ? jobDescriptor : jobDescriptor.but(jd -> jd.getJobGroupInfo().toBuilder().withSequence(sequence + '_' + finalI));
schedule(effective, jobScenario);
}
return this;
}
Aggregations