hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [5/5] hbase git commit: HBASE-19150 TestSnapshotWithAcl is flaky
Date Thu, 02 Nov 2017 01:21:28 GMT
HBASE-19150 TestSnapshotWithAcl is flaky

Signed-off-by: Andrew Purtell <apurtell@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/acc0ed6e
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/acc0ed6e
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/acc0ed6e

Branch: refs/heads/branch-1.4
Commit: acc0ed6eb1077d85f6d0551658b3f1180622c823
Parents: 9780ea8
Author: churro <churro@apache.org>
Authored: Wed Nov 1 12:14:12 2017 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Wed Nov 1 18:18:02 2017 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/client/TestSnapshotWithAcl.java  | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/acc0ed6e/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotWithAcl.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotWithAcl.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotWithAcl.java
index 6e9f1db..b3f137b 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotWithAcl.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotWithAcl.java
@@ -28,6 +28,7 @@ import org.apache.hadoop.hbase.coprocessor.CoprocessorHost;
 import org.apache.hadoop.hbase.master.MasterCoprocessorHost;
 import org.apache.hadoop.hbase.security.User;
 import org.apache.hadoop.hbase.security.access.AccessControlConstants;
+import org.apache.hadoop.hbase.security.access.AccessControlLists;
 import org.apache.hadoop.hbase.security.access.AccessController;
 import org.apache.hadoop.hbase.security.access.Permission;
 import org.apache.hadoop.hbase.security.access.SecureTestUtil;
@@ -41,11 +42,12 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import java.io.IOException;
+import java.util.UUID;
 
 @Category(MediumTests.class)
 public class TestSnapshotWithAcl extends SecureTestUtil {
 
-  public TableName TEST_TABLE = TableName.valueOf("TestSnapshotWithAcl");
+  public TableName TEST_TABLE = TableName.valueOf(UUID.randomUUID().toString());
 
   private static final int ROW_COUNT = 30000;
 
@@ -119,6 +121,7 @@ public class TestSnapshotWithAcl extends SecureTestUtil {
     // Enable EXEC permission checking
     conf.setBoolean(AccessControlConstants.EXEC_PERMISSION_CHECKS_KEY, true);
     TEST_UTIL.startMiniCluster();
+    TEST_UTIL.waitUntilAllRegionsAssigned(AccessControlLists.ACL_TABLE_NAME);
     MasterCoprocessorHost cpHost =
         TEST_UTIL.getMiniHBaseCluster().getMaster().getMasterCoprocessorHost();
     cpHost.load(AccessController.class, Coprocessor.PRIORITY_HIGHEST, conf);
@@ -193,11 +196,11 @@ public class TestSnapshotWithAcl extends SecureTestUtil {
     loadData();
     verifyRows(TEST_TABLE);
 
-    String snapshotName1 = "testSnapshot1";
+    String snapshotName1 = UUID.randomUUID().toString();
     admin.snapshot(snapshotName1, TEST_TABLE);
 
     // clone snapshot with restoreAcl true.
-    TableName tableName1 = TableName.valueOf("tableName1");
+    TableName tableName1 = TableName.valueOf(UUID.randomUUID().toString());
     admin.cloneSnapshot(snapshotName1, tableName1, true);
     verifyRows(tableName1);
     verifyAllowed(new AccessReadAction(tableName1), USER_OWNER, USER_RO, USER_RW);
@@ -206,7 +209,7 @@ public class TestSnapshotWithAcl extends SecureTestUtil {
     verifyDenied(new AccessWriteAction(tableName1), USER_RO, USER_NONE);
 
     // clone snapshot with restoreAcl false.
-    TableName tableName2 = TableName.valueOf("tableName2");
+    TableName tableName2 = TableName.valueOf(UUID.randomUUID().toString());
     admin.cloneSnapshot(snapshotName1, tableName2, false);
     verifyRows(tableName2);
     verifyAllowed(new AccessReadAction(tableName2), USER_OWNER);


Mime
View raw message