From 95b7f5081384b105db2a7b801d9b913c48b00d7a Mon Sep 17 00:00:00 2001 From: Jonathan Turner Eagles Date: Fri, 14 Mar 2014 21:58:42 +0000 Subject: [PATCH] YARN-1833. TestRMAdminService Fails in trunk and branch-2 (Mit Desais via jeagles) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1577737 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../server/resourcemanager/TestRMAdminService.java | 13 +++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 87c2c3a4d1..0924fce6ab 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -35,6 +35,9 @@ Release 2.5.0 - UNRELEASED YARN-1429. *nix: Allow a way for users to augment classpath of YARN daemons. (Jarek Jarcec Cecho via kasha) + YARN-1833. TestRMAdminService Fails in trunk and branch-2 (Mit Desais via + jeagles) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMAdminService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMAdminService.java index 79e7603e57..ab199d1d39 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMAdminService.java +++ b/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 void testRefreshUserToGroupsMappingsWithLocalConfigurationProvider() { configuration.set(YarnConfiguration.RM_CONFIGURATION_PROVIDER_CLASS, "org.apache.hadoop.yarn.FileSystemBasedConfigurationProvider"); - String user = UserGroupInformation.getCurrentUser().getUserName(); - List groupWithInit = - new ArrayList(Groups.getUserToGroupsMappingService( - configuration).getGroups(user)); + String[] defaultTestUserGroups = {"dummy_group1", "dummy_group2"}; + UserGroupInformation ugi = UserGroupInformation.createUserForTesting + ("dummyUser", defaultTestUserGroups); + + String user = ugi.getUserName(); + List groupWithInit = new ArrayList(2); + for(int i = 0; i < ugi.getGroupNames().length; i++ ) { + groupWithInit.add(ugi.getGroupNames()[i]); + } // upload default configurations uploadDefaultConfiguration();