YARN-7090. testRMRestartAfterNodeLabelDisabled get failed when CapacityScheduler is configured. Contributed by Wangda Tan.

This commit is contained in:
Junping Du 2017-08-23 18:06:29 -07:00
parent 1000a2af04
commit 652dd434d9
1 changed files with 16 additions and 0 deletions

View File

@ -2504,6 +2504,22 @@ public class TestRMRestart extends ParameterizedSchedulerTestBase {
@Test(timeout = 60000)
public void testRMRestartAfterNodeLabelDisabled() throws Exception {
if (getSchedulerType() != SchedulerType.CAPACITY) {
return;
}
// Initial FS node label store root dir to a random tmp dir
File nodeLabelFsStoreDir = new File("target",
this.getClass().getSimpleName()
+ "-testRMRestartAfterNodeLabelDisabled");
if (nodeLabelFsStoreDir.exists()) {
FileUtils.deleteDirectory(nodeLabelFsStoreDir);
}
nodeLabelFsStoreDir.deleteOnExit();
String nodeLabelFsStoreDirURI = nodeLabelFsStoreDir.toURI().toString();
conf.set(YarnConfiguration.FS_NODE_LABELS_STORE_ROOT_DIR,
nodeLabelFsStoreDirURI);
conf.setBoolean(YarnConfiguration.NODE_LABELS_ENABLED, true);
MockRM rm1 = new MockRM(