From 6d2e1fde6318e0a8517a2b1281b3f7fd4963c342 Mon Sep 17 00:00:00 2001 From: Jonathan Turner Eagles Date: Fri, 28 Mar 2014 19:30:08 +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/trunk@1582862 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 269d615fb84..77ad8a5a923 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -48,6 +48,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"); + } } }