Search in sources :

Example 1 with SchedulerTHelper

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

the class TestCacheSpaceCleaning method startDedicatedScheduler.

@BeforeClass
public static void startDedicatedScheduler() throws Exception {
    RMFactory.setOsJavaProperty();
    // start an empty scheduler and add a node source with modified properties
    schedulerHelper = new SchedulerTHelper(true, true);
    List<String> arguments = new ArrayList<>();
    arguments.addAll(RMTHelper.setup.getJvmParametersAsList());
    arguments.add("-D" + DataSpaceNodeConfigurationAgent.NODE_DATASPACE_CACHE_CLEANING_PERIOD + "=" + 2000);
    arguments.add("-D" + DataSpaceNodeConfigurationAgent.NODE_DATASPACE_CACHE_INVALIDATION_PERIOD + "=" + 40000);
    schedulerHelper.createNodeSource("CleaningNS", 5, arguments);
}
Also used : SchedulerTHelper(functionaltests.utils.SchedulerTHelper) ArrayList(java.util.ArrayList) BeforeClass(org.junit.BeforeClass)

Example 2 with SchedulerTHelper

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

the class TestDataspaceConcurrentKilling method startDedicatedScheduler.

@BeforeClass
public static void startDedicatedScheduler() throws Exception {
    // we start a scheduler with an empty RM and add multiple nodes
    schedulerHelper = new SchedulerTHelper(true, true, new File(SchedulerFunctionalTest.class.getResource("/functionaltests/config/scheduler-nonforkedscripttasks.ini").toURI()).getAbsolutePath());
    schedulerHelper.createNodeSource(JOB_NAME, NB_NODES);
}
Also used : SchedulerTHelper(functionaltests.utils.SchedulerTHelper) SchedulerFunctionalTest(functionaltests.utils.SchedulerFunctionalTest) File(java.io.File) BeforeClass(org.junit.BeforeClass)

Example 3 with SchedulerTHelper

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

the class TestDataspaceConcurrentTransfer method startDedicatedScheduler.

@BeforeClass
public static void startDedicatedScheduler() throws Exception {
    // we start a scheduler with an empty RM and add multiple nodes
    schedulerHelper = new SchedulerTHelper(true, true, new File(SchedulerFunctionalTest.class.getResource("/functionaltests/config/scheduler-nonforkedscripttasks.ini").toURI()).getAbsolutePath());
    schedulerHelper.createNodeSource(JOB_NAME, NB_NODES);
}
Also used : SchedulerTHelper(functionaltests.utils.SchedulerTHelper) SchedulerFunctionalTest(functionaltests.utils.SchedulerFunctionalTest) File(java.io.File) BeforeClass(org.junit.BeforeClass)

Example 4 with SchedulerTHelper

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

the class TestSubmitJobWithPartiallyUnaccessibleDataSpaces method before.

@BeforeClass
public static void before() throws Throwable {
    spaceRoot = tmpFolder.newFolder("space");
    spaceRootUser = new File(spaceRoot, "demo");
    spaceRootUser.mkdirs();
    deployer = new FileSystemServerDeployer(spaceRoot.getAbsolutePath(), false);
    SchedulerTHelper.log("Dataspace started in : " + spaceRoot.getAbsolutePath());
    File inputFile = new File(spaceRootUser, "myfilein1");
    inputFile.createNewFile();
    File propertiesfile = new File(configFile.toURI());
    String propContent = FileUtils.readFileToString(propertiesfile, Charset.defaultCharset().toString());
    String newContent = propContent.replace("$$TOREPLACE$$", deployer.getVFSRootURL());
    FileUtils.writeStringToFile(propertiesfile, newContent);
    schedulerHelper = new SchedulerTHelper(true, propertiesfile.getAbsolutePath());
}
Also used : SchedulerTHelper(functionaltests.utils.SchedulerTHelper) FileSystemServerDeployer(org.objectweb.proactive.extensions.vfsprovider.FileSystemServerDeployer) File(java.io.File) BeforeClass(org.junit.BeforeClass)

Example 5 with SchedulerTHelper

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

the class RunningTaskRecoveryWhenNodesAreReservedInBatchTest method action.

@Test
public void action() throws Throwable {
    nodes = schedulerHelper.createRMNodeStarterNodes(RunningTaskRecoveryWhenNodesAreReservedInBatchTest.class.getSimpleName(), NB_NODES);
    for (int i = 0; i < NB_NODES; i++) {
        schedulerHelper.waitForAnyNodeEvent(RMEventType.NODE_ADDED);
    }
    JobId jobid = schedulerHelper.submitJob(new File(JOB_DESCRIPTOR.toURI()).getAbsolutePath());
    schedulerHelper.waitForEventJobRunning(jobid);
    schedulerHelper.waitForEventTaskFinished(jobid, "Groovy_Task");
    JobState jobState = schedulerHelper.getSchedulerInterface().getJobState(jobid);
    SchedulerTHelper.log("Total number of tasks: " + jobState.getTotalNumberOfTasks());
    List<TaskState> tasks = jobState.getTasks();
    TaskState fifthTask = tasks.get(5);
    SchedulerTHelper.log("Wait for the fifth task running");
    // we wait for the fifth task to be running so that when we kill the
    // scheduler we have a mix of pending/submitted/running tasks
    schedulerHelper.waitForEventTaskRunning(fifthTask.getJobId(), fifthTask.getName());
    SchedulerTHelper.log("Fifth task is running");
    // restart scheduler
    printRmStateAndReturnNotFreeNodeNumber();
    printJobStateAndReturnNumberOfRunningTasks(jobid);
    TestScheduler.kill();
    schedulerHelper = new SchedulerTHelper(false, new File(SCHEDULER_CONFIGURATION_RESTART.toURI()).getAbsolutePath(), new File(RM_CONFIGURATION_RESTART.toURI()).getAbsolutePath(), null, false);
    SchedulerTHelper.log("Wait for job to finish");
    JobInfo jobInfo = schedulerHelper.waitForEventJobFinished(jobid);
    assertThat(jobInfo.getNumberOfFailedTasks()).isEqualTo(0);
    assertThat(jobInfo.getNumberOfInErrorTasks()).isEqualTo(0);
    // wait for all nodes released
    while (printRmStateAndReturnNotFreeNodeNumber() != 0) {
        schedulerHelper.waitForAnyNodeEvent(RMEventType.NODE_STATE_CHANGED);
    }
    // all nodes should be free now
    int notFreeNodeNumber = printRmStateAndReturnNotFreeNodeNumber();
    assertThat(notFreeNodeNumber).isEqualTo(0);
}
Also used : SchedulerTHelper(functionaltests.utils.SchedulerTHelper) JobInfo(org.ow2.proactive.scheduler.common.job.JobInfo) JobState(org.ow2.proactive.scheduler.common.job.JobState) File(java.io.File) TaskState(org.ow2.proactive.scheduler.common.task.TaskState) 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