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 <elserj@apache.org>
Signrd-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
Wellington Ramos Chevreuil 2022-01-18 12:32:27 +00:00 committed by Wellington Chevreuil
parent f1dd865c35
commit e3e42df7f2
1 changed files with 1 additions and 2 deletions

View File

@ -351,8 +351,7 @@ public abstract class User {
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);
}
}