hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject hbase git commit: HBASE-13005 TestDeleteTableHandler failing in 0.98 hadoop 1 builds
Date Thu, 12 Feb 2015 18:12:27 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 2fad653ff -> 4ee823b3f


HBASE-13005 TestDeleteTableHandler failing in 0.98 hadoop 1 builds


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

Branch: refs/heads/0.98
Commit: 4ee823b3f2dd33551e9481ebbad2dee4a2a1ebd6
Parents: 2fad653
Author: Andrew Purtell <apurtell@apache.org>
Authored: Thu Feb 12 10:08:54 2015 -0800
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Thu Feb 12 10:08:54 2015 -0800

----------------------------------------------------------------------
 .../master/handler/TestDeleteTableHandler.java  | 23 +++++++++++++++-----
 1 file changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/4ee823b3/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestDeleteTableHandler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestDeleteTableHandler.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestDeleteTableHandler.java
index 3962c2f..60ad2f2 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestDeleteTableHandler.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestDeleteTableHandler.java
@@ -66,11 +66,13 @@ public class TestDeleteTableHandler {
   @Test(timeout=60000)
   public void testDeleteForSureClearsAllTableRowsFromMeta()
   throws IOException, InterruptedException {
+    // Create a test table
     final TableName tableName = TableName.valueOf("testDeleteForSureClearsAllTableRowsFromMeta");
     final HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
     final HTableDescriptor desc = new HTableDescriptor(tableName);
     desc.addFamily(new HColumnDescriptor(FAMILYNAME));
     admin.createTable(desc, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE);
+
     // Now I have a nice table, mangle it by removing the HConstants.REGIONINFO_QUALIFIER_STR
     // content from a few of the rows.
     Scan metaScannerForMyTable = MetaReader.getScanForTableName(tableName);
@@ -88,11 +90,20 @@ public class TestDeleteTableHandler {
       } finally {
         scanner.close();
       }
-      admin.disableTable(tableName);
-      TEST_UTIL.waitTableDisabled(tableName.getName());
-      admin.deleteTable(tableName);
-      int rowCount = 0;
-      scanner = metaTable.getScanner(metaScannerForMyTable);
+    } finally {
+      metaTable.close();
+    }
+
+    // Now delete the table
+    admin.disableTable(tableName);
+    TEST_UTIL.waitTableDisabled(tableName.getName());
+    admin.deleteTable(tableName);
+
+    // Check that all META rows for the deleted table have really been removed
+    metaTable = new HTable(TEST_UTIL.getConfiguration(), TableName.META_TABLE_NAME);
+    int rowCount = 0;
+    try {
+      ResultScanner scanner = metaTable.getScanner(metaScannerForMyTable);
       try {
         for (Result result : scanner) {
           rowCount++;
@@ -100,10 +111,10 @@ public class TestDeleteTableHandler {
       } finally {
         scanner.close();
       }
-      assertEquals(0, rowCount);
     } finally {
       metaTable.close();
     }
+    assertEquals(0, rowCount);
   }
 }
 


Mime
View raw message