Search in sources :

Example 46 with JobId

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();
}
Also used : ExecuterInformation(org.ow2.proactive.scheduler.task.internal.ExecuterInformation) InternalScriptTask(org.ow2.proactive.scheduler.task.internal.InternalScriptTask) InternalJob(org.ow2.proactive.scheduler.job.InternalJob) TaskId(org.ow2.proactive.scheduler.common.task.TaskId) InternalTask(org.ow2.proactive.scheduler.task.internal.InternalTask) JobIdImpl(org.ow2.proactive.scheduler.job.JobIdImpl) InternalTaskFlowJob(org.ow2.proactive.scheduler.job.InternalTaskFlowJob) JobId(org.ow2.proactive.scheduler.common.job.JobId) Test(org.junit.Test)

Example 47 with JobId

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);
}
Also used : InternalTask(org.ow2.proactive.scheduler.task.internal.InternalTask) ArrayList(java.util.ArrayList) InternalTaskFlowJob(org.ow2.proactive.scheduler.job.InternalTaskFlowJob) JobDescriptorImpl(org.ow2.proactive.scheduler.descriptor.JobDescriptorImpl)

Example 48 with JobId

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"));
}
Also used : JobIdImpl(org.ow2.proactive.scheduler.job.JobIdImpl) JobId(org.ow2.proactive.scheduler.common.job.JobId) Test(org.junit.Test)

Example 49 with JobId

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"));
}
Also used : TaskId(org.ow2.proactive.scheduler.common.task.TaskId) JobIdImpl(org.ow2.proactive.scheduler.job.JobIdImpl) JobId(org.ow2.proactive.scheduler.common.job.JobId) Test(org.junit.Test)

Example 50 with JobId

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)));
}
Also used : SchedulerTHelper(functionaltests.utils.SchedulerTHelper) TaskFlowJob(org.ow2.proactive.scheduler.common.job.TaskFlowJob) JobState(org.ow2.proactive.scheduler.common.job.JobState) Test(org.junit.Test)

Aggregations

JobId (org.ow2.proactive.scheduler.common.job.JobId)179 Test (org.junit.Test)121 Scheduler (org.ow2.proactive.scheduler.common.Scheduler)73 File (java.io.File)58 TaskResult (org.ow2.proactive.scheduler.common.task.TaskResult)57 UnknownJobException (org.ow2.proactive.scheduler.common.exception.UnknownJobException)55 TaskFlowJob (org.ow2.proactive.scheduler.common.job.TaskFlowJob)55 JobState (org.ow2.proactive.scheduler.common.job.JobState)51 ArrayList (java.util.ArrayList)45 PermissionException (org.ow2.proactive.scheduler.common.exception.PermissionException)43 NotConnectedException (org.ow2.proactive.scheduler.common.exception.NotConnectedException)42 JobIdImpl (org.ow2.proactive.scheduler.job.JobIdImpl)40 InternalJob (org.ow2.proactive.scheduler.job.InternalJob)38 TaskId (org.ow2.proactive.scheduler.common.task.TaskId)37 JobResult (org.ow2.proactive.scheduler.common.job.JobResult)36 Path (javax.ws.rs.Path)35 NotConnectedRestException (org.ow2.proactive_grid_cloud_portal.scheduler.exception.NotConnectedRestException)35 PermissionRestException (org.ow2.proactive_grid_cloud_portal.scheduler.exception.PermissionRestException)34 Produces (javax.ws.rs.Produces)33 UnknownJobRestException (org.ow2.proactive_grid_cloud_portal.scheduler.exception.UnknownJobRestException)33