You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2025/06/06 14:25:46 UTC

(hbase) branch branch-2.6 updated: HBASE-29369 Fix TestZKPermissionWatcher (#7067)

This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.6 by this push:
     new cd854184939 HBASE-29369 Fix TestZKPermissionWatcher (#7067)
cd854184939 is described below

commit cd854184939c8d927ae235bf1f36e20189eae9cd
Author: Duo Zhang <zh...@apache.org>
AuthorDate: Wed Jun 4 15:06:51 2025 +0800

    HBASE-29369 Fix TestZKPermissionWatcher (#7067)
    
    Signed-off-by: Nihal Jain <ni...@apache.org>
    (cherry picked from commit 2f57499b115d9a626cf0d509a57dab4f1f6a0854)
---
 .../hbase/security/access/TestZKPermissionWatcher.java   | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestZKPermissionWatcher.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestZKPermissionWatcher.java
index 8b31db18713..25920e06b2a 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestZKPermissionWatcher.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestZKPermissionWatcher.java
@@ -152,26 +152,26 @@ public class TestZKPermissionWatcher {
   @Test
   public void testRaceConditionOnPermissionUpdate() throws Exception {
     Configuration conf = UTIL.getConfiguration();
-    User george = User.createUserForTesting(conf, "george", new String[] {});
-    User hubert = User.createUserForTesting(conf, "hubert", new String[] {});
+    User tom = User.createUserForTesting(conf, "tom", new String[] {});
+    User jerry = User.createUserForTesting(conf, "jerry", new String[] {});
     ListMultimap<String, UserPermission> permissions = ArrayListMultimap.create();
 
     // update ACL: george RW
     writeToZookeeper(WATCHER_A,
-      updatePermissions(permissions, george, Permission.Action.READ, Permission.Action.WRITE));
+      updatePermissions(permissions, tom, Permission.Action.READ, Permission.Action.WRITE));
     waitForModification(AUTH_A, 1000);
 
     // check it
-    assertTrue(AUTH_A.authorizeUserTable(george, TEST_TABLE, Permission.Action.READ));
-    assertTrue(AUTH_A.authorizeUserTable(george, TEST_TABLE, Permission.Action.WRITE));
+    assertTrue(AUTH_A.authorizeUserTable(tom, TEST_TABLE, Permission.Action.READ));
+    assertTrue(AUTH_A.authorizeUserTable(tom, TEST_TABLE, Permission.Action.WRITE));
 
     // update ACL: hubert A
-    writeToZookeeper(WATCHER_A, updatePermissions(permissions, hubert, Permission.Action.ADMIN));
+    writeToZookeeper(WATCHER_A, updatePermissions(permissions, jerry, Permission.Action.ADMIN));
     // intended not to waitForModification(AUTH_A, 1000);
     // check george permission should not be updated/removed while updating permission for hubert
     for (int i = 0; i < 5000; i++) {
-      assertTrue(AUTH_A.authorizeUserTable(george, TEST_TABLE, Permission.Action.READ));
-      assertTrue(AUTH_A.authorizeUserTable(george, TEST_TABLE, Permission.Action.WRITE));
+      assertTrue(AUTH_A.authorizeUserTable(tom, TEST_TABLE, Permission.Action.READ));
+      assertTrue(AUTH_A.authorizeUserTable(tom, TEST_TABLE, Permission.Action.WRITE));
     }
   }