HBASE-6906 TestHBaseFsck#testQuarantine* tests are flakey due to TestNotEnabledException

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1392455 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Hsieh 2012-10-01 17:33:30 +00:00
parent 7b640037fb
commit e9947aad05
1 changed files with 13 additions and 1 deletions

View File

@ -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);
}