From 49c747ab187d0650143205ba57ca19607ec4c6bd Mon Sep 17 00:00:00 2001 From: Yufei Gu Date: Fri, 16 Mar 2018 16:25:33 -0700 Subject: [PATCH] YARN-8039. Clean up log dir configuration in TestLinuxContainerExecutorWithMocks.testStartLocalizer. Contributed by Miklos Szegedi. --- .../nodemanager/TestLinuxContainerExecutorWithMocks.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 e7a333e21b..a110f10331 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 @@ -150,6 +150,7 @@ public void setup() throws IOException, ContainerExecutionException { LinuxContainerRuntime linuxContainerRuntime; LinuxContainerRuntime mockLinuxContainerRuntime; + conf.set(YarnConfiguration.NM_LOG_DIRS, "src/test/resources"); setupMockExecutor(MOCK_EXECUTOR, conf); linuxContainerRuntime = new DefaultLinuxContainerRuntime( PrivilegedOperationExecutor.getInstance(conf)); @@ -281,7 +282,8 @@ public void testStartLocalizer() throws IOException { Assert.assertEquals(result.get(13), "-Dlog4j.configuration=container-log4j.properties" ); Assert.assertEquals(result.get(14), - "-Dyarn.app.container.log.dir=${yarn.log.dir}/userlogs/application_0/12345"); + String.format("-Dyarn.app.container.log.dir=%s/application_0/12345", + mockExec.getConf().get(YarnConfiguration.NM_LOG_DIRS))); Assert.assertEquals(result.get(15), "-Dyarn.app.container.log.filesize=0"); Assert.assertEquals(result.get(16), "-Dhadoop.root.logger=INFO,CLA");