Skip to content

Commit

Permalink
HBASE-26662 User.createUserForTesting should not reset UserProvider.g…
Browse files Browse the repository at this point in the history
…roups 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>
  • Loading branch information
wchevreuil committed Jan 18, 2022
1 parent 540fbe5 commit 5d14589
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,7 @@ public <T> T runAs(PrivilegedExceptionAction<T> 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);
}
}
Expand Down

0 comments on commit 5d14589

Please sign in to comment.