hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1503961 - /hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
Date Wed, 17 Jul 2013 00:51:37 GMT
Author: stack
Date: Wed Jul 17 00:51:36 2013
New Revision: 1503961

URL: http://svn.apache.org/r1503961
Log:
HBASE-8964 TestAccessController.testGlobalAuthorizationForNewRegisteredRS

Modified:
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java?rev=1503961&r1=1503960&r2=1503961&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
Wed Jul 17 00:51:36 2013
@@ -127,6 +127,7 @@ public class TestAccessController {
   // user with no permissions
   private static User USER_NONE;
 
+  private static byte[] TEST_TABLE2 = Bytes.toBytes("testtable2");
   private static byte[] TEST_FAMILY = Bytes.toBytes("f1");
 
   private static MasterCoprocessorEnvironment CP_ENV;
@@ -1917,7 +1918,7 @@ public class TestAccessController {
     verifyDenied(cloneAction, USER_CREATE, USER_RW, USER_RO, USER_NONE, USER_OWNER);
   }
 
-  @Test (timeout=30000)
+  @Test
   public void testGlobalAuthorizationForNewRegisteredRS() throws Exception {
     LOG.debug("Test for global authorization for a new registered RegionServer.");
     MiniHBaseCluster hbaseCluster = TEST_UTIL.getHBaseCluster();
@@ -1940,8 +1941,7 @@ public class TestAccessController {
       acl.close();
     }
     HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
-    final byte [] tableName = Bytes.toBytes("testGlobalAuthorizationForNewRegisteredRS");
-    HTableDescriptor htd = new HTableDescriptor(tableName);
+    HTableDescriptor htd = new HTableDescriptor(TEST_TABLE2);
     htd.addFamily(new HColumnDescriptor(TEST_FAMILY));
     admin.createTable(htd);
 
@@ -1951,7 +1951,7 @@ public class TestAccessController {
     final HRegionServer newRs = newRsThread.getRegionServer();
 
     // Move region to the new RegionServer.
-    HTable table = new HTable(TEST_UTIL.getConfiguration(), tableName);
+    HTable table = new HTable(TEST_UTIL.getConfiguration(), TEST_TABLE2);
     try {
       NavigableMap<HRegionInfo, ServerName> regions = table
           .getRegionLocations();
@@ -1968,25 +1968,25 @@ public class TestAccessController {
       };
       SUPERUSER.runAs(moveAction);
 
-      final int RETRIES_LIMIT = 100;
+      final int RETRIES_LIMIT = 10;
       int retries = 0;
-      while (newRs.getOnlineRegions(tableName).size() < 1 && retries < RETRIES_LIMIT)
{
-        LOG.debug("Waiting for a region to be opened. Already retried " + retries + " times.");
+      while (newRs.getOnlineRegions(TEST_TABLE2).size() < 1 && retries < RETRIES_LIMIT)
{
+        LOG.debug("Waiting for region to be opened. Already retried " + retries
+            + " times.");
         try {
-          Thread.sleep(1000);
+          Thread.sleep(200);
         } catch (InterruptedException e) {
         }
         retries++;
         if (retries == RETRIES_LIMIT - 1) {
-          fail("Retry exhaust for waiting region to be opened: " +
-            newRs.getOnlineRegions(tableName));
+          fail("Retry exhaust for waiting region to be opened.");
         }
       }
       // Verify write permission for user "admin2" who has the global
       // permissions.
       PrivilegedExceptionAction putAction = new PrivilegedExceptionAction() {
         public Object run() throws Exception {
-          HTable table = new HTable(TEST_UTIL.getConfiguration(), tableName);
+          HTable table = new HTable(TEST_UTIL.getConfiguration(), TEST_TABLE2);
           Put put = new Put(Bytes.toBytes("test"));
           put.add(TEST_FAMILY, Bytes.toBytes("qual"), Bytes.toBytes("value"));
           table.put(put);



Mime
View raw message