From b38c88b9d6e91ddb3fcc62cde9692b561fc32dce Mon Sep 17 00:00:00 2001 From: Wellington Ramos Chevreuil Date: Tue, 18 Jan 2022 12:32:27 +0000 Subject: [PATCH] HBASE-26662 User.createUserForTesting should not reset UserProvider.groups every time if hbase.group.service.for.test.only is true (#4029) Signed-off-by: Josh Elser Signrd-off-by: Duo Zhang --- .../src/main/java/org/apache/hadoop/hbase/security/User.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/security/User.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/security/User.java index 97d80ba20a7a..f88f65a9f709 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/security/User.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/security/User.java @@ -351,8 +351,7 @@ public T runAs(PrivilegedExceptionAction action) public static User createUserForTesting(Configuration conf, String name, String[] groups) { synchronized (UserProvider.class) { - if (!(UserProvider.groups instanceof TestingGroups) || - conf.getBoolean(TestingGroups.TEST_CONF, false)) { + if (!(UserProvider.groups instanceof TestingGroups)) { UserProvider.groups = new TestingGroups(UserProvider.groups); } }