Search in sources :

Example 11 with SchedulerTHelper

use of functionaltests.utils.SchedulerTHelper 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)

Example 12 with SchedulerTHelper

use of functionaltests.utils.SchedulerTHelper in project scheduling by ow2-proactive.

the class SchedulerEfficiencyMetricsTest 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", taskNumber);
    final TaskFlowJob job = createJob(taskNumber, TASK_DURATION);
    long start = System.currentTimeMillis();
    jobId = schedulerHelper.submitJob(job);
    long submited = System.currentTimeMillis();
    schedulerHelper.waitForEventJobFinished(jobId);
    final JobState jobState = schedulerHelper.getSchedulerInterface().getJobState(jobId);
    final long finished = jobState.getFinishedTime();
    long latestTaskStart = Long.MIN_VALUE;
    for (TaskState taskState : jobState.getTasks()) {
        if (taskState.getStartTime() > latestTaskStart) {
            latestTaskStart = taskState.getStartTime();
        }
    }
    long TCT = submited - start;
    long TST = latestTaskStart - submited;
    long TTT = finished - latestTaskStart - TASK_DURATION;
    logAndAssert("TaskCreationTimeTest", TCT);
    logAndAssert("TaskSchedulingTimeTest", TST);
    logAndAssert("TaskTerminationTimeTest", TTT);
}
Also used : SchedulerTHelper(functionaltests.utils.SchedulerTHelper) TaskFlowJob(org.ow2.proactive.scheduler.common.job.TaskFlowJob) JobState(org.ow2.proactive.scheduler.common.job.JobState) TaskState(org.ow2.proactive.scheduler.common.task.TaskState) Test(org.junit.Test)

Example 13 with SchedulerTHelper

use of functionaltests.utils.SchedulerTHelper in project scheduling by ow2-proactive.

the class TaskCreationTimeTest method taskCreationRate.

@Test(timeout = 3600000)
public void taskCreationRate() throws Exception {
    ProActiveConfiguration.load();
    RMFactory.setOsJavaProperty();
    schedulerHelper = new SchedulerTHelper(false, SCHEDULER_CONFIGURATION_START.getPath(), RM_CONFIGURATION_START.getPath(), null);
    schedulerHelper.createNodeSourceWithInfiniteTimeout("local", 1);
    final TaskFlowJob job = SchedulerEfficiencyMetricsTest.createJob(taskNumber, TASK_DURATION);
    final long start = System.currentTimeMillis();
    jobId = schedulerHelper.submitJob(job);
    final long anActualTime = System.currentTimeMillis() - start;
    LOGGER.info(makeCSVString(TaskCreationTimeTest.class.getSimpleName(), taskNumber, timeLimit, anActualTime, ((anActualTime < timeLimit) ? SUCCESS : FAILURE)));
}
Also used : SchedulerTHelper(functionaltests.utils.SchedulerTHelper) TaskFlowJob(org.ow2.proactive.scheduler.common.job.TaskFlowJob) Test(org.junit.Test)

Example 14 with SchedulerTHelper

use of functionaltests.utils.SchedulerTHelper in project scheduling by ow2-proactive.

the class TaskSchedulingTimeTest 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", numberOfExperiments);
    final TaskFlowJob job = SchedulerEfficiencyMetricsTest.createJob(1, 10);
    long totalTime = 0;
    for (int i = 0; i < numberOfExperiments; ++i) {
        JobId jobId = schedulerHelper.submitJob(job);
        jobIds.add(jobId);
        schedulerHelper.waitForEventJobFinished(jobId);
        final JobState jobState = schedulerHelper.getSchedulerInterface().getJobState(jobId);
        final long submittedTime = jobState.getSubmittedTime();
        final long taskStartTime = jobState.getTasks().get(0).getStartTime();
        final long timeToScheduleTask = taskStartTime - submittedTime;
        totalTime += timeToScheduleTask;
    }
    long averageTime = totalTime / numberOfExperiments;
    LOGGER.info(makeCSVString("AverageTaskSchedulingTime", numberOfExperiments, timeLimit, averageTime, ((averageTime < 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) JobId(org.ow2.proactive.scheduler.common.job.JobId) Test(org.junit.Test)

Example 15 with SchedulerTHelper

use of functionaltests.utils.SchedulerTHelper in project scheduling by ow2-proactive.

the class JobRecoveryTest method startKillStartScheduler.

/**
 * This method tests performance of jobs recovery using local infrastructure.
 *
 * @throws Exception
 */
public void startKillStartScheduler() throws Exception {
    ProActiveConfiguration.load();
    RMFactory.setOsJavaProperty();
    schedulerHelper = new SchedulerTHelper(false, SCHEDULER_CONFIGURATION_START, NodeRecoveryTest.RM_CONFIGURATION_START, null);
    schedulerHelper.createNodeSourceWithInfiniteTimeout("local", jobsNumber);
    JobId[] jobIds = new JobId[jobsNumber];
    for (int i = 0; i < jobsNumber; ++i) {
        jobIds[i] = schedulerHelper.submitJob(new File(runningJob.toURI()).getAbsolutePath());
    }
    for (int i = 0; i < jobsNumber; ++i) {
        schedulerHelper.waitForEventJobRunning(jobIds[i]);
    }
    NodesRecoveryProcessHelper.findPidAndSendSigKill(SchedulerStartForFunctionalTest.class.getSimpleName());
    schedulerHelper = new SchedulerTHelper(false, SCHEDULER_CONFIGURATION_RESTART, NodeRecoveryTest.RM_CONFIGURATION_RESTART, null);
}
Also used : SchedulerTHelper(functionaltests.utils.SchedulerTHelper) SchedulerStartForFunctionalTest(functionaltests.utils.SchedulerStartForFunctionalTest) File(java.io.File) JobId(org.ow2.proactive.scheduler.common.job.JobId)

Aggregations

SchedulerTHelper (functionaltests.utils.SchedulerTHelper)27 File (java.io.File)14 BeforeClass (org.junit.BeforeClass)14 Test (org.junit.Test)7 ArrayList (java.util.ArrayList)5 JobState (org.ow2.proactive.scheduler.common.job.JobState)5 TaskFlowJob (org.ow2.proactive.scheduler.common.job.TaskFlowJob)5 JobId (org.ow2.proactive.scheduler.common.job.JobId)4 TaskState (org.ow2.proactive.scheduler.common.task.TaskState)3 SchedulerFunctionalTest (functionaltests.utils.SchedulerFunctionalTest)2 Before (org.junit.Before)2 TestListenJobLogs (functionaltests.job.log.TestListenJobLogs)1 SchedulerStartForFunctionalTest (functionaltests.utils.SchedulerStartForFunctionalTest)1 TestScheduler (functionaltests.utils.TestScheduler)1 FileSystemServerDeployer (org.objectweb.proactive.extensions.vfsprovider.FileSystemServerDeployer)1 Scheduler (org.ow2.proactive.scheduler.common.Scheduler)1 JobInfo (org.ow2.proactive.scheduler.common.job.JobInfo)1 JobResult (org.ow2.proactive.scheduler.common.job.JobResult)1 TaskResult (org.ow2.proactive.scheduler.common.task.TaskResult)1 LogForwardingService (org.ow2.proactive.scheduler.common.util.logforwarder.LogForwardingService)1