You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Wellington Chevreuil (Jira)" <ji...@apache.org> on 2022/01/13 16:06:00 UTC
[jira] [Created] (HBASE-26662) User.createUserForTesting should not reset UserProvider.groups every time if hbase.group.service.for.test.only is true
Wellington Chevreuil created HBASE-26662:
--------------------------------------------
Summary: User.createUserForTesting should not reset UserProvider.groups every time if hbase.group.service.for.test.only is true
Key: HBASE-26662
URL: https://issues.apache.org/jira/browse/HBASE-26662
Project: HBase
Issue Type: Bug
Reporter: Wellington Chevreuil
Assignee: Wellington Chevreuil
The _if check_ below will always unnecessarily reset static var _UserProvider.groups_ to a newly created instance of TestingGroups every time `User.createUserForTesting` is called.
{noformat}
if (!(UserProvider.groups instanceof TestingGroups) ||
conf.getBoolean(TestingGroups.TEST_CONF, false)) {
UserProvider.groups = new TestingGroups(UserProvider.groups);
}
{noformat}
For tests creating multiple {_}test users{_}, this causes the latest created user to reset _groups_ and all previously created users would now have to be available on the {_}User.underlyingImplementation{_}, which not always will be true.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)