hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vvasu...@apache.org
Subject [1/2] hadoop git commit: YARN-5444. Fix failing unit tests in TestLinuxContainerExecutorWithMocks. Contributed by Yufei Gu.
Date Mon, 01 Aug 2016 10:40:59 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 f197378f8 -> 7ecb1635b
  refs/heads/trunk 770b5eb2d -> 95694b70c


YARN-5444. Fix failing unit tests in TestLinuxContainerExecutorWithMocks. Contributed by Yufei
Gu.

(cherry picked from commit 4455aa7c86a36b6e017e288479a7d4ced889faa0)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/7ecb1635
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/7ecb1635
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/7ecb1635

Branch: refs/heads/branch-2
Commit: 7ecb1635b44fa9bfdb6ca4c15517ecf87295afdf
Parents: f197378
Author: Varun Vasudev <vvasudev@apache.org>
Authored: Mon Aug 1 16:00:17 2016 +0530
Committer: Varun Vasudev <vvasudev@apache.org>
Committed: Mon Aug 1 16:01:10 2016 +0530

----------------------------------------------------------------------
 .../yarn/server/nodemanager/LinuxContainerExecutor.java     | 1 +
 .../nodemanager/TestLinuxContainerExecutorWithMocks.java    | 9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/7ecb1635/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LinuxContainerExecutor.java
----------------------------------------------------------------------
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 04e38fa..8f5ee6b 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;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/7ecb1635/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLinuxContainerExecutorWithMocks.java
----------------------------------------------------------------------
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 8e67fb3..52da28e 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<String> command = new ArrayList<String>();
+    List<String> command = new ArrayList<String>();
+    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<String> 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" );


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message