You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by in...@apache.org on 2018/05/23 23:02:23 UTC

[4/5] hadoop git commit: YARN-8327. Fix TestAggregatedLogFormat#testReadAcontainerLogs1 on Windows. Contributed by Giovanni Matteo Fumarola.

YARN-8327. Fix TestAggregatedLogFormat#testReadAcontainerLogs1 on Windows. Contributed by Giovanni Matteo Fumarola.

(cherry picked from commit f09dc73001fd5f3319765fa997f4b0ca9e8f2aff)


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

Branch: refs/heads/branch-2
Commit: aa3b20b76268ed0130fcf5dc03157537f6b007dc
Parents: 8f43ade
Author: Inigo Goiri <in...@apache.org>
Authored: Wed May 23 15:59:30 2018 -0700
Committer: Inigo Goiri <in...@apache.org>
Committed: Wed May 23 16:01:37 2018 -0700

----------------------------------------------------------------------
 .../logaggregation/TestAggregatedLogFormat.java  | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/aa3b20b7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/logaggregation/TestAggregatedLogFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/logaggregation/TestAggregatedLogFormat.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/logaggregation/TestAggregatedLogFormat.java
index efbaa4c..f85445e 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/logaggregation/TestAggregatedLogFormat.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/logaggregation/TestAggregatedLogFormat.java
@@ -254,13 +254,18 @@ public class TestAggregatedLogFormat {
     // Since we could not open the fileInputStream for stderr, this file is not
     // aggregated.
     String s = writer.toString();
-    int expectedLength =
-        "LogType:stdout".length()
-            + (logUploadedTime ? ("\nLog Upload Time:" + Times.format(System
-              .currentTimeMillis())).length() : 0)
-            + ("\nLogLength:" + numChars).length()
-            + "\nLog Contents:\n".length() + numChars + "\n".length()
-            + "\nEnd of LogType:stdout\n".length();
+
+    int expectedLength = "LogType:stdout".length()
+        + (logUploadedTime
+            ? (System.lineSeparator() + "Log Upload Time:"
+                + Times.format(System.currentTimeMillis())).length()
+            : 0)
+        + (System.lineSeparator() + "LogLength:" + numChars).length()
+        + (System.lineSeparator() + "Log Contents:" + System.lineSeparator())
+            .length()
+        + numChars + ("\n").length() + ("End of LogType:stdout"
+            + System.lineSeparator() + System.lineSeparator()).length();
+
     Assert.assertTrue("LogType not matched", s.contains("LogType:stdout"));
     Assert.assertTrue("log file:stderr should not be aggregated.", !s.contains("LogType:stderr"));
     Assert.assertTrue("log file:logs should not be aggregated.", !s.contains("LogType:logs"));


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