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 <[email protected]>
Signrd-off-by: Duo Zhang <[email protected]>
  • Loading branch information
wchevreuil authored Jan 18, 2022
1 parent c9bcd87 commit 4a94cfc
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 4a94cfc

Please sign in to comment.