JobConf conf = getJobConf();
conf.setSpeculativeExecution(false);
conf.set(MRJobConfig.SETUP_CLEANUP_NEEDED, "false");
conf.setNumTasksToExecutePerJvm(-1);
conf.setQueueName(queues[0]);
SleepJob sleepJob1 = new SleepJob();
sleepJob1.setConf(conf);
jobs[0] = sleepJob1.createJob(1, 1, 1, 1, 1, 1);
jobs[0].submit();
JobConf conf2 = getJobConf();
conf2.setSpeculativeExecution(false);
conf2.setNumTasksToExecutePerJvm(-1);
conf2.setQueueName(queues[1]);
SleepJob sleepJob2 = new SleepJob();
sleepJob2.setConf(conf2);
jobs[1] = sleepJob2.createJob(3, 3, 5, 3, 5, 3);
jobs[0].waitForCompletion(false);
jobs[1].waitForCompletion(false);
assertTrue(
"Sleep job submitted to queue 1 is not successful", jobs[0]
.isSuccessful());