瀏覽代碼

YARN-1833. TestRMAdminService Fails in trunk and branch-2 (Mit Desais via jeagles)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2.4@1579249 13f79535-47bb-0310-9956-ffa450edef68
Jonathan Turner Eagles 11 年之前
父節點
當前提交
7cd13126b5

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

@@ -264,6 +264,9 @@ Release 2.4.0 - UNRELEASED
     YARN-1512. Enhanced CapacityScheduler to be able to decouple scheduling from
     node-heartbeats. (Arun C Murthy via vinodkv)
 
+    YARN-1833. TestRMAdminService Fails in trunk and branch-2 (Mit Desais via
+    jeagles)
+
   OPTIMIZATIONS
 
   BUG FIXES

+ 9 - 4
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMAdminService.java

@@ -377,10 +377,15 @@ public class TestRMAdminService {
     configuration.set(YarnConfiguration.RM_CONFIGURATION_PROVIDER_CLASS,
         "org.apache.hadoop.yarn.FileSystemBasedConfigurationProvider");
 
-    String user = UserGroupInformation.getCurrentUser().getUserName();
-    List<String> groupWithInit =
-        new ArrayList<String>(Groups.getUserToGroupsMappingService(
-            configuration).getGroups(user));
+    String[] defaultTestUserGroups = {"dummy_group1", "dummy_group2"};
+    UserGroupInformation ugi = UserGroupInformation.createUserForTesting
+        ("dummyUser", defaultTestUserGroups);
+
+    String user = ugi.getUserName();
+    List<String> groupWithInit = new ArrayList<String>(2);
+     for(int i = 0; i < ugi.getGroupNames().length; i++ ) {
+       groupWithInit.add(ugi.getGroupNames()[i]);
+     }
 
     // upload default configurations
     uploadDefaultConfiguration();