diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LinuxContainerExecutor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LinuxContainerExecutor.java index 04e38fa87bd..8f5ee6b92cf 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LinuxContainerExecutor.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LinuxContainerExecutor.java @@ -97,6 +97,7 @@ public class LinuxContainerExecutor extends ContainerExecutor { resourcesHandler = getResourcesHandler(conf); + containerSchedPriorityIsSet = false; if (conf.get(YarnConfiguration.NM_CONTAINER_EXECUTOR_SCHED_PRIORITY) != null) { containerSchedPriorityIsSet = true; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLinuxContainerExecutorWithMocks.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLinuxContainerExecutorWithMocks.java index ae5a011172f..23f58bb7f02 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLinuxContainerExecutorWithMocks.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLinuxContainerExecutorWithMocks.java @@ -128,7 +128,7 @@ public class TestLinuxContainerExecutorWithMocks { tmpMockExecutor = System.getProperty("test.build.data") + "/tmp-mock-container-executor"; - Configuration conf = new Configuration(); + Configuration conf = new YarnConfiguration(); LinuxContainerRuntime linuxContainerRuntime; setupMockExecutor(MOCK_EXECUTOR, conf); @@ -220,7 +220,10 @@ public class TestLinuxContainerExecutorWithMocks { public void testLaunchCommandWithoutPriority() throws IOException { // make sure the command doesn't contain the nice -n since priority // not specified - List command = new ArrayList(); + List command = new ArrayList(); + Configuration conf = mockExec.getConf(); + conf.unset(YarnConfiguration.NM_CONTAINER_EXECUTOR_SCHED_PRIORITY); + mockExec.setConf(conf); mockExec.addSchedPriorityCommand(command); assertEquals("addSchedPriority should be empty", 0, command.size()); } @@ -243,7 +246,7 @@ public class TestLinuxContainerExecutorWithMocks { .build()); List result=readMockParams(); - Assert.assertEquals(result.size(), 18); + Assert.assertEquals(result.size(), 19); Assert.assertEquals(result.get(0), YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER); Assert.assertEquals(result.get(1), "test"); Assert.assertEquals(result.get(2), "0" );