Forráskód Böngészése

YARN-852. Merging change r1494735 from branch-2 to branch-2.1-beta.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2.1-beta@1494737 13f79535-47bb-0310-9956-ffa450edef68
Chris Nauroth 12 éve
szülő
commit
1e18c6db87

+ 3 - 0
hadoop-yarn-project/CHANGES.txt

@@ -636,6 +636,9 @@ Release 2.1.0-beta - UNRELEASED
     YARN-597. TestFSDownload fails on Windows due to dependencies on
     tar/gzip/jar tools. (Ivan Mitic via acmurthy) 
 
+    YARN-852. TestAggregatedLogFormat.testContainerLogsFileAccess fails on
+    Windows. (Chuan Liu via cnauroth)
+
     YARN-795. Fair scheduler queue metrics should subtract allocated vCores from 
     available vCores. (ywskycn via tucu) 
 

+ 14 - 7
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/logaggregation/TestAggregatedLogFormat.java

@@ -206,27 +206,34 @@ public class TestAggregatedLogFormat {
       sb.append(line);
     }
     line = sb.toString();
-    
+
+    String expectedOwner = ugi.getShortUserName();
+    if (Path.WINDOWS) {
+      final String adminsGroupString = "Administrators";
+      if (Arrays.asList(ugi.getGroupNames()).contains(adminsGroupString)) {
+        expectedOwner = adminsGroupString;
+      }
+    }
     String stdoutFile1 =
         StringUtils.join(
-            Path.SEPARATOR,
+            File.separator,
             Arrays.asList(new String[] {
-                srcFileRoot.toUri().toString(),
+                workDir.getAbsolutePath(), "srcFiles",
                 testContainerId1.getApplicationAttemptId().getApplicationId()
                     .toString(), testContainerId1.toString(), stderr }));
     String message1 =
-        "Owner '" + ugi.getShortUserName() + "' for path " + stdoutFile1
+        "Owner '" + expectedOwner + "' for path " + stdoutFile1
         + " did not match expected owner '" + randomUser + "'";
     
     String stdoutFile2 =
         StringUtils.join(
-            Path.SEPARATOR,
+            File.separator,
             Arrays.asList(new String[] {
-                srcFileRoot.toUri().toString(),
+                workDir.getAbsolutePath(), "srcFiles",
                 testContainerId1.getApplicationAttemptId().getApplicationId()
                     .toString(), testContainerId1.toString(), stdout }));
     String message2 =
-        "Owner '" + ugi.getShortUserName() + "' for path "
+        "Owner '" + expectedOwner + "' for path "
             + stdoutFile2 + " did not match expected owner '"
             + ugi.getShortUserName() + "'";