From a467e88ae4c1dacb022288fe6d4805a7f719cd12 Mon Sep 17 00:00:00 2001 From: Jonathan Turner Eagles Date: Fri, 28 Mar 2014 19:45:05 +0000 Subject: [PATCH] YARN-1883. TestRMAdminService fails due to inconsistent entries in UserGroups (Mit Desai via jeagles) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1582865 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../resourcemanager/TestRMAdminService.java | 17 +++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 2a850e01e22..48fe1e26171 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -33,6 +33,9 @@ Release 2.5.0 - UNRELEASED YARN-1136. Replace junit.framework.Assert with org.junit.Assert (Chen He via jeagles) + YARN-1883. TestRMAdminService fails due to inconsistent entries in + UserGroups (Mit Desai 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 ab199d1d39e..32e78ebf182 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 @@ -90,6 +90,9 @@ public class TestRMAdminService { fs.delete(tmpDir, true); fs.mkdirs(workingPath); fs.mkdirs(tmpDir); + + // reset the groups to what it default test settings + MockUnixGroupsMapping.resetGroups(); } @After @@ -785,12 +788,7 @@ public class TestRMAdminService { private static class MockUnixGroupsMapping implements GroupMappingServiceProvider { - @SuppressWarnings("serial") - private static List group = new ArrayList() {{ - add("test_group_A"); - add("test_group_B"); - add("test_group_C"); - }}; + private static List group = new ArrayList(); @Override public List getGroups(String user) throws IOException { @@ -813,6 +811,13 @@ public class TestRMAdminService { group.add("test_group_E"); group.add("test_group_F"); } + + public static void resetGroups() { + group.clear(); + group.add("test_group_A"); + group.add("test_group_B"); + group.add("test_group_C"); + } } }