use of org.ow2.proactive.scheduler.task.internal.InternalScriptTask in project scheduling by ow2-proactive.
the class TerminateReplicateTaskHandlerTest method generateInitiatorTask.
private InternalTask generateInitiatorTask() {
InternalJob job = new InternalTaskFlowJob("initiator", JobPriority.NORMAL, OnTaskError.CANCEL_JOB, "description");
InternalTask initiatorTask = new InternalScriptTask(job);
initiatorTask.setId(TaskIdImpl.createTaskId(new JobIdImpl(666L, "JobName"), "readableName", 111L));
initiatorTask.setReplicationIndex(1);
return initiatorTask;
}
use of org.ow2.proactive.scheduler.task.internal.InternalScriptTask in project scheduling by ow2-proactive.
the class DefaultPolicyTest method createSingleTaskJob.
private JobDescriptorImpl createSingleTaskJob(JobPriority jobPriority) {
InternalTaskFlowJob taskFlowJob = new InternalTaskFlowJob("test", jobPriority, OnTaskError.CANCEL_JOB, "");
taskFlowJob.setId(JobIdImpl.makeJobId(Integer.toString(jobId++)));
ArrayList<InternalTask> tasks = new ArrayList<>();
tasks.add(new InternalScriptTask(taskFlowJob));
taskFlowJob.addTasks(tasks);
return new JobDescriptorImpl(taskFlowJob);
}
use of org.ow2.proactive.scheduler.task.internal.InternalScriptTask in project scheduling by ow2-proactive.
the class InternalTaskParentFinderTest method generateInternalTask.
private InternalTask generateInternalTask(long id, TaskStatus taskStatus) {
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"), "readableName", id));
internalTask.setStatus(taskStatus);
return internalTask;
}
use of org.ow2.proactive.scheduler.task.internal.InternalScriptTask in project scheduling by ow2-proactive.
the class LiveJobsTest method testRestartTaskOnNodeRunning0ExecutionsLeft.
@Test(timeout = 60000)
public void testRestartTaskOnNodeRunning0ExecutionsLeft() throws UnknownJobException, UnknownTaskException {
PASchedulerProperties.NUMBER_OF_EXECUTION_ON_FAILURE.updateProperty("0");
InternalJob job = new InternalTaskFlowJob("test-name", JobPriority.NORMAL, OnTaskError.CANCEL_JOB, "description");
JobId id = new JobIdImpl(666L, "test-name");
job.setId(id);
List<InternalTask> tasksList = new ArrayList<>();
InternalScriptTask internalTask = new InternalScriptTask(job);
internalTask.setName("task-name");
internalTask.setStatus(TaskStatus.RUNNING);
internalTask.setMaxNumberOfExecution(5);
internalTask.setExecuterInformation(Mockito.mock(ExecuterInformation.class));
tasksList.add(internalTask);
job.setTasks(tasksList);
liveJobs.jobSubmitted(job);
liveJobs.lockJobsToSchedule();
liveJobs.taskStarted(job, job.getTask("task-name"), null);
assertThat(internalTask.getMaxNumberOfExecutionOnFailure(), is(0));
assertThat(internalTask.getTaskInfo().getNumberOfExecutionOnFailureLeft(), is(0));
liveJobs.restartTaskOnNodeFailure(internalTask);
internalTask.setStatus(TaskStatus.RUNNING);
Mockito.verify(dbManager, Mockito.times(0)).taskRestarted(job, internalTask, null);
}
use of org.ow2.proactive.scheduler.task.internal.InternalScriptTask in project scheduling by ow2-proactive.
the class LiveJobsTest method testLockJobsToSchedule.
@Test(timeout = 60000)
public void testLockJobsToSchedule() throws UnknownJobException, UnknownTaskException {
InternalJob job = new InternalTaskFlowJob("test-name", JobPriority.NORMAL, OnTaskError.CANCEL_JOB, "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");
tasksList.add(internalTask);
job.setTasks(tasksList);
liveJobs.jobSubmitted(job);
liveJobs.pauseJob(id);
assertThat(liveJobs.lockJobsToSchedule().size(), is(1));
}
Aggregations