hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmhs...@apache.org
Subject svn commit: r1392455 - /hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
Date Mon, 01 Oct 2012 17:33:30 GMT
Author: jmhsieh
Date: Mon Oct  1 17:33:30 2012
New Revision: 1392455

URL: http://svn.apache.org/viewvc?rev=1392455&view=rev
Log:
HBASE-6906 TestHBaseFsck#testQuarantine* tests are flakey due to TestNotEnabledException

Modified:
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java?rev=1392455&r1=1392454&r2=1392455&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
Mon Oct  1 17:33:30 2012
@@ -1383,6 +1383,9 @@ public class TestHBaseFsck {
     }
   }
 
+  /**
+  * Test that use this should have a timeout, because this method could potentially wait
forever.
+  */
   private void doQuarantineTest(String table, HBaseFsck hbck, int check, int corrupt, int
fail,
       int quar, int missing) throws Exception {
     try {
@@ -1405,7 +1408,16 @@ public class TestHBaseFsck {
       assertEquals(hfcc.getMissing().size(), missing);
 
       // its been fixed, verify that we can enable
-      TEST_UTIL.getHBaseAdmin().enableTable(table);
+      HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
+      admin.enableTableAsync(table);
+      while (!admin.isTableEnabled(table)) {
+        try {
+          Thread.sleep(250);
+        } catch (InterruptedException e) {
+          e.printStackTrace();
+          fail("Interrupted when trying to enable table " + table);
+        }
+      }
     } finally {
       deleteTable(table);
     }



Mime
View raw message