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:
parent
540fbe51b0
commit
5d14589314
|
@ -351,8 +351,7 @@ public abstract class User {
|
||||||
public static User createUserForTesting(Configuration conf,
|
public static User createUserForTesting(Configuration conf,
|
||||||
String name, String[] groups) {
|
String name, String[] groups) {
|
||||||
synchronized (UserProvider.class) {
|
synchronized (UserProvider.class) {
|
||||||
if (!(UserProvider.groups instanceof TestingGroups) ||
|
if (!(UserProvider.groups instanceof TestingGroups)) {
|
||||||
conf.getBoolean(TestingGroups.TEST_CONF, false)) {
|
|
||||||
UserProvider.groups = new TestingGroups(UserProvider.groups);
|
UserProvider.groups = new TestingGroups(UserProvider.groups);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue