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/18 13:25:00 UTC
[jira] [Resolved] (HBASE-26662) User.createUserForTesting should not reset UserProvider.groups every time if hbase.group.service.for.test.only is true
[ https://issues.apache.org/jira/browse/HBASE-26662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wellington Chevreuil resolved HBASE-26662.
------------------------------------------
Resolution: Fixed
Thanks for reviewing it, [~elserj] , [~zhangduo] !
> 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
> Affects Versions: 2.5.0, 3.0.0-alpha-2, 2.4.9, 2.6.0
> Reporter: Wellington Chevreuil
> Assignee: Wellington Chevreuil
> Priority: Major
> Fix For: 2.5.0, 2.6.0, 3.0.0-alpha-3, 2.4.10
>
>
> 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)