From 6b9bd3d3c7b23ffc3bee1dd580596180727543ff Mon Sep 17 00:00:00 2001 From: zhengchenyu Date: Wed, 20 Sep 2023 19:30:51 +0800 Subject: [PATCH] fix ut --- .../app/job/impl/TestMapReduceChildJVM.java | 58 +++++++++---------- .../TestLinuxContainerExecutorWithMocks.java | 2 +- .../launcher/TestContainerLaunch.java | 2 +- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestMapReduceChildJVM.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestMapReduceChildJVM.java index e2510c6d7b3022..5216a2f5234861 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestMapReduceChildJVM.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestMapReduceChildJVM.java @@ -58,20 +58,20 @@ public void testCommandLine() throws Exception { app.verifyCompleted(); Assert.assertEquals( - "[" + MRApps.crossPlatformify("JAVA_HOME") + "/bin/java" + - " -Djava.net.preferIPv4Stack=true" + - " -Dhadoop.metrics.log.level=WARN " + - " -Xmx820m -Djava.io.tmpdir=" + MRApps.crossPlatformify("PWD") + "/tmp" + - " -Dlog4j.configuration=container-log4j.properties" + - " -Dyarn.app.container.log.dir=" + - " -Dyarn.app.container.log.filesize=10240" + - " -Dhadoop.root.logger=INFO,CLA -Dhadoop.root.logfile=syslog" + - " org.apache.hadoop.mapred.YarnChild 127.0.0.1" + - " 54321" + - " attempt_0_0000_m_000000_0" + - " 0" + - " 1>/stdout" + - " 2>/stderr ]", app.launchCmdList.get(0)); + "[" + MRApps.crossPlatformify("JAVA_HOME") + "/bin/java" + + " -Djava.net.preferIPv4Stack=true" + + " -Dhadoop.metrics.log.level=WARN " + + " -Xmx820m -Djava.io.tmpdir=" + MRApps.crossPlatformify("PWD") + "/tmp" + + " -Dlog4j.configuration=container-log4j.properties" + + " -Dyarn.app.container.log.dir=" + + " -Dyarn.app.container.log.filesize=10485760" + + " -Dhadoop.root.logger=INFO,CLA -Dhadoop.root.logfile=syslog" + + " org.apache.hadoop.mapred.YarnChild 127.0.0.1" + + " 54321" + + " attempt_0_0000_m_000000_0" + + " 0" + + " 1>/stdout" + + " 2>/stderr ]", app.launchCmdList.get(0)); Assert.assertTrue("HADOOP_ROOT_LOGGER not set for job", app.cmdEnvironment.containsKey("HADOOP_ROOT_LOGGER")); @@ -127,7 +127,7 @@ private void testReduceCommandLine(Configuration conf) " -Xmx820m -Djava.io.tmpdir=" + MRApps.crossPlatformify("PWD") + "/tmp" + " -Dlog4j.configuration=container-log4j.properties" + " -Dyarn.app.container.log.dir=" + - " -Dyarn.app.container.log.filesize=10240" + + " -Dyarn.app.container.log.filesize=10485760" + " -Dhadoop.root.logger=INFO,CLA -Dhadoop.root.logfile=syslog" + " -Dyarn.app.mapreduce.shuffle.logger=INFO," + appenderName + " -Dyarn.app.mapreduce.shuffle.logfile=syslog.shuffle" + @@ -163,20 +163,20 @@ public void testCommandLineWithLog4JConifg() throws Exception { app.verifyCompleted(); Assert.assertEquals( - "[" + MRApps.crossPlatformify("JAVA_HOME") + "/bin/java" + - " -Djava.net.preferIPv4Stack=true" + - " -Dhadoop.metrics.log.level=WARN " + - " -Xmx820m -Djava.io.tmpdir=" + MRApps.crossPlatformify("PWD") + "/tmp" + - " -Dlog4j.configuration=" + testLogPropertieFile + - " -Dyarn.app.container.log.dir=" + - " -Dyarn.app.container.log.filesize=10240" + - " -Dhadoop.root.logger=INFO,CLA -Dhadoop.root.logfile=syslog" + - " org.apache.hadoop.mapred.YarnChild 127.0.0.1" + - " 54321" + - " attempt_0_0000_m_000000_0" + - " 0" + - " 1>/stdout" + - " 2>/stderr ]", app.launchCmdList.get(0)); + "[" + MRApps.crossPlatformify("JAVA_HOME") + "/bin/java" + + " -Djava.net.preferIPv4Stack=true" + + " -Dhadoop.metrics.log.level=WARN " + + " -Xmx820m -Djava.io.tmpdir=" + MRApps.crossPlatformify("PWD") + "/tmp" + + " -Dlog4j.configuration=" + testLogPropertieFile + + " -Dyarn.app.container.log.dir=" + + " -Dyarn.app.container.log.filesize=10485760" + + " -Dhadoop.root.logger=INFO,CLA -Dhadoop.root.logfile=syslog" + + " org.apache.hadoop.mapred.YarnChild 127.0.0.1" + + " 54321" + + " attempt_0_0000_m_000000_0" + + " 0" + + " 1>/stdout" + + " 2>/stderr ]", app.launchCmdList.get(0)); } @Test 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 69581157128fb0..3d9d33c5a10dd5 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 @@ -323,7 +323,7 @@ public void testStartLocalizer() throws IOException { String.format("-Dyarn.app.container.log.dir=%s/application_0/12345", mockExec.getConf().get(YarnConfiguration.NM_LOG_DIRS))); assertThat(result.get(15)).isEqualTo( - "-Dyarn.app.container.log.filesize=10240"); + "-Dyarn.app.container.log.filesize=0"); assertThat(result.get(16)).isEqualTo("-Dhadoop.root.logger=INFO,CLA"); assertThat(result.get(17)).isEqualTo( "-Dhadoop.root.logfile=container-localizer-syslog"); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/TestContainerLaunch.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/TestContainerLaunch.java index f5d37325585baa..b45b785f5a53b2 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/TestContainerLaunch.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/TestContainerLaunch.java @@ -945,7 +945,7 @@ private void verifyTailErrorLogOnContainerExit(Configuration conf, invalidCommand.add("-Djava.io.tmpdir=$PWD/tmp"); invalidCommand.add("-Dlog4j.configuration=container-log4j.properties"); invalidCommand.add("-Dyarn.app.container.log.dir=" + containerLogDir); - invalidCommand.add("-Dyarn.app.container.log.filesize=10240"); + invalidCommand.add("-Dyarn.app.container.log.filesize=10485760"); invalidCommand.add("-Dhadoop.root.logger=INFO,CLA"); invalidCommand.add("-Dhadoop.root.logfile=syslog"); invalidCommand.add("-Xmx1024m");