JobConf conf = getJobConf();
conf.setSpeculativeExecution(false);
conf.set("mapred.committer.job.setup.cleanup.needed", "false");
conf.setNumTasksToExecutePerJvm(-1);
conf.setQueueName(queues[0]);
SleepJob sleepJob1 = new SleepJob();
sleepJob1.setConf(conf);
JobConf sleepJobConf = sleepJob1.setupJobConf(1, 1, 1, 1, 1, 1);
jobs[0] = runJob(sleepJobConf, true);
JobConf conf2 = getJobConf();
conf2.setSpeculativeExecution(false);
conf2.set("mapred.committer.job.setup.cleanup.needed", "false");
conf2.setNumTasksToExecutePerJvm(-1);
conf2.setQueueName(queues[1]);
SleepJob sleepJob2 = new SleepJob();
sleepJob2.setConf(conf2);
JobConf sleep2 = sleepJob2.setupJobConf(3, 3, 5, 3, 5, 3);
jobs[1] = runJob(sleep2, false);
assertTrue("Sleep job submitted to queue 1 is not successful", jobs[0]
.isSuccessful());
assertTrue("Sleep job submitted to queue 2 is not successful", jobs[1]
.isSuccessful());