use of org.ow2.proactive.scheduler.common.job.JobId in project scheduling by ow2-proactive.
the class TerminationDataTest method testHandleTerminationForTaskNodeFailureTermination.
@Test
public void testHandleTerminationForTaskNodeFailureTermination() throws IOException, ClassNotFoundException {
InternalJob job = new InternalTaskFlowJob("test-name", JobPriority.NORMAL, OnTaskError.CANCEL_JOB, "description");
JobId jobId = new JobIdImpl(666, "readableName");
InternalTask internalTask = new InternalScriptTask(job);
TaskId taskId = TaskIdImpl.createTaskId(jobId, "task-name", 777L);
internalTask.setId(taskId);
internalTask.setName("task-name");
internalTask.setStatus(TaskStatus.RUNNING);
internalTask.setExecuterInformation(Mockito.mock(ExecuterInformation.class));
RunningTaskData taskData = new RunningTaskData(internalTask, "user", null, launcher);
terminationData.addTaskData(null, taskData, TerminationData.TerminationStatus.NODEFAILED, null);
terminationData.handleTermination(service);
Mockito.verify(launcher, Mockito.times(0)).kill();
}
use of org.ow2.proactive.scheduler.common.job.JobId 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.common.job.JobId in project scheduling by ow2-proactive.
the class JobLoggerTest method testGetJobLogFilename.
@Test
public void testGetJobLogFilename() {
JobId id = new JobIdImpl(1123, "readableName");
assertThat(JobLogger.getJobLogRelativePath(id), is("1123/1123"));
}
use of org.ow2.proactive.scheduler.common.job.JobId in project scheduling by ow2-proactive.
the class TaskLoggerTest method testGetJobLogFilename.
@Test
public void testGetJobLogFilename() {
JobId jobId = new JobIdImpl(1123, "readableName");
TaskId taskId = TaskIdImpl.createTaskId(jobId, "taskreadableName", 123123);
assertThat(TaskLogger.getTaskLogRelativePath(taskId), is("1123/1123t123123"));
}
use of org.ow2.proactive.scheduler.common.job.JobId in project scheduling by ow2-proactive.
the class ParallelTaskSchedulingTest method test.
@Test(timeout = 3600000)
public void test() throws Exception {
ProActiveConfiguration.load();
RMFactory.setOsJavaProperty();
schedulerHelper = new SchedulerTHelper(false, SCHEDULER_CONFIGURATION_START.getPath(), RM_CONFIGURATION_START.getPath(), null);
schedulerHelper.createNodeSourceWithInfiniteTimeout("local", numberOfNodes);
final TaskFlowJob job = createJob(numberOfTasks);
jobId = schedulerHelper.submitJob(job);
schedulerHelper.waitForEventJobFinished(jobId);
final JobState jobState = schedulerHelper.getSchedulerInterface().getJobState(jobId);
final long timeToMeasure = jobState.getFinishedTime() - jobState.getStartTime();
LOGGER.info(makeCSVString(ParallelTaskSchedulingTest.class.getSimpleName(), numberOfTasks, timeLimit, timeToMeasure, ((timeToMeasure < timeLimit) ? SUCCESS : FAILURE)));
}
Aggregations