From a973fd514f153572182a822e6bf930b11be1a81d Mon Sep 17 00:00:00 2001 From: Dima Spivak Date: Tue, 28 Oct 2014 23:40:22 +0000 Subject: [PATCH] HBASE-12312 Another couple of createTable race conditions Signed-off-by: stack --- .../apache/hadoop/hbase/replication/TestReplicationBase.java | 2 ++ .../hadoop/hbase/security/access/TestAccessController.java | 4 ++++ .../hbase/security/access/TestScanEarlyTermination.java | 3 +-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationBase.java index ea524a18896..de46f25a87a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationBase.java @@ -141,7 +141,9 @@ public class TestReplicationBase { Admin admin1 = new HBaseAdmin(conf1); Admin admin2 = new HBaseAdmin(conf2); admin1.createTable(table, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); + utility1.waitUntilAllRegionsAssigned(tableName); admin2.createTable(table, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); + utility2.waitUntilAllRegionsAssigned(tableName); htable1 = new HTable(conf1, tableName); htable1.setWriteBufferSize(1024); htable2 = new HTable(conf2, tableName); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java index 9dde6269ea9..cf1c7bcec71 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java @@ -1049,6 +1049,7 @@ public class TestAccessController extends SecureTestUtil { htd.addFamily(new HColumnDescriptor(family1)); htd.addFamily(new HColumnDescriptor(family2)); admin.createTable(htd); + TEST_UTIL.waitUntilAllRegionsAssigned(tableName); // create temp users User tblUser = User @@ -1323,6 +1324,7 @@ public class TestAccessController extends SecureTestUtil { htd.addFamily(new HColumnDescriptor(family1)); htd.addFamily(new HColumnDescriptor(family2)); admin.createTable(htd); + TEST_UTIL.waitUntilAllRegionsAssigned(tableName); // create temp users User user = User.createUserForTesting(TEST_UTIL.getConfiguration(), "user", new String[0]); @@ -1438,6 +1440,7 @@ public class TestAccessController extends SecureTestUtil { htd.addFamily(new HColumnDescriptor(family2)); htd.setOwner(USER_OWNER); admin.createTable(htd); + TEST_UTIL.waitUntilAllRegionsAssigned(tableName); List perms; @@ -1911,6 +1914,7 @@ public class TestAccessController extends SecureTestUtil { HTableDescriptor htd = new HTableDescriptor(TEST_TABLE2); htd.addFamily(new HColumnDescriptor(TEST_FAMILY)); admin.createTable(htd); + TEST_UTIL.waitUntilAllRegionsAssigned(TEST_TABLE2); // Starting a new RegionServer. JVMClusterUtil.RegionServerThread newRsThread = hbaseCluster diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestScanEarlyTermination.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestScanEarlyTermination.java index 6d7ff61efe6..af5ed89dae4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestScanEarlyTermination.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestScanEarlyTermination.java @@ -127,8 +127,7 @@ public class TestScanEarlyTermination extends SecureTestUtil { htd.setConfiguration(AccessControlConstants.CF_ATTRIBUTE_EARLY_OUT, "true"); admin.createTable(htd); - - TEST_UTIL.waitTableEnabled(TEST_TABLE.getTableName()); + TEST_UTIL.waitUntilAllRegionsAssigned(TEST_TABLE.getTableName()); } @After