use of org.ow2.proactive.scheduler.job.InternalTaskFlowJob in project scheduling by ow2-proactive.
the class LiveJobsTest method testFinishInErrorTaskDoesNotFinishPendingTask.
@Test(timeout = 60000)
public void testFinishInErrorTaskDoesNotFinishPendingTask() throws UnknownTaskException, UnknownJobException {
InternalJob job = new InternalTaskFlowJob("test-name", JobPriority.NORMAL, OnTaskError.CONTINUE_JOB_EXECUTION, "description");
JobId id = new JobIdImpl(666L, "test-name");
job.setId(id);
List<InternalTask> tasksList = new ArrayList<>();
InternalTask internalTask = new InternalScriptTask(job);
internalTask.setName("task-name");
internalTask.setStatus(TaskStatus.PENDING);
tasksList.add(internalTask);
job.setTasks(tasksList);
liveJobs.jobSubmitted(job);
liveJobs.finishInErrorTask(job.getId(), "task-name");
assertThat(internalTask.getStatus(), is(TaskStatus.PENDING));
}
use of org.ow2.proactive.scheduler.job.InternalTaskFlowJob in project scheduling by ow2-proactive.
the class SchedulingServiceTest method testRestartTaskOnNodeFailure.
@Test
public void testRestartTaskOnNodeFailure() {
InternalJob job = new InternalTaskFlowJob("test-name", JobPriority.NORMAL, OnTaskError.CANCEL_JOB, "description");
InternalTask task = new InternalScriptTask(job);
ExecutorService executorService = Mockito.mock(ExecutorService.class);
Mockito.when(infrastructure.getInternalOperationsThreadPool()).thenReturn(executorService);
schedulingService.restartTaskOnNodeFailure(task);
Mockito.verify(executorService, Mockito.times(1)).submit(any(Runnable.class));
}
use of org.ow2.proactive.scheduler.job.InternalTaskFlowJob in project scheduling by ow2-proactive.
the class ExtendedSchedulerPolicyTest method createTask.
private InternalScriptTask createTask(String taskStartAt) {
InternalJob job = new InternalTaskFlowJob("test-name", JobPriority.NORMAL, OnTaskError.CANCEL_JOB, "description");
InternalScriptTask task1 = new InternalScriptTask(job);
if (taskStartAt != null) {
task1.addGenericInformation("START_AT", taskStartAt);
}
return task1;
}
use of org.ow2.proactive.scheduler.job.InternalTaskFlowJob in project scheduling by ow2-proactive.
the class ExtendedSchedulerPolicyTest method createJobDescWithTwoTasks.
private JobDescriptor createJobDescWithTwoTasks(String jobStartAt, String oneTaskStartAt, String otherTaskStartAt) {
InternalTaskFlowJob taskFlowJob = new InternalTaskFlowJob("test", JobPriority.NORMAL, OnTaskError.CANCEL_JOB, "");
taskFlowJob.setId(JobIdImpl.makeJobId(Integer.toString(jobId++)));
ArrayList<InternalTask> tasks = new ArrayList<>();
tasks.add(createTask(oneTaskStartAt));
tasks.add(createTask(otherTaskStartAt));
taskFlowJob.addTasks(tasks);
if (jobStartAt != null) {
taskFlowJob.addGenericInformation("START_AT", jobStartAt);
}
return new JobDescriptorImpl(taskFlowJob);
}
use of org.ow2.proactive.scheduler.job.InternalTaskFlowJob in project scheduling by ow2-proactive.
the class TerminateReplicateTaskHandlerTest method generateInternalTask.
private InternalTask generateInternalTask(long id) {
InternalJob job = new InternalTaskFlowJob("test-name", JobPriority.NORMAL, OnTaskError.CANCEL_JOB, "description");
InternalTask internalTask = new InternalScriptTask(job);
internalTask.setId(TaskIdImpl.createTaskId(new JobIdImpl(666L, "JobName"), "test-name-" + id, id));
internalTask.setName("test-name-" + id);
internalTask.setStatus(TaskStatus.PENDING);
return internalTask;
}
Aggregations