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)));
}
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);
}
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)));
}
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)));
}
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);
}
Aggregations