Description
Running TestJavaActionExecutor fails with fair scheduler
Failed tests: testSubmitWithLauncherQueue(org.apache.oozie.action.hadoop.TestJavaActionExecutor): expected:<[]test> but was:<[root.]test>
Reason: FairScheduler adds a "root." prefix to the queue name in org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.QueueManager.ensureRootPrefix()
A potential way to fix the test case:
- we can add a new function
private boolean isFairSchedulerUsed(Configuration conf) { return conf.get("yarn.resourcemanager.scheduler.class").contains(FairScheduler.class.getName()); }
that can be called from testSubmitWithLauncherQueue():
... if (isFairSchedulerUsed(conf)) { assertEquals("root.test", queue); } else { assertEquals("test", queue); } ...