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