HBASE-6507 [hbck] TestHBaseFsck ran into TableNotEnabledException

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1369363 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
jxiang 2012-08-04 16:40:38 +00:00
parent 87a250924c
commit ffe24f3c97
1 changed files with 12 additions and 0 deletions

View File

@ -312,6 +312,18 @@ public class TestHBaseFsck {
}
tbl.put(puts);
tbl.flushCommits();
long endTime = System.currentTimeMillis() + 60000;
while (!TEST_UTIL.getHBaseAdmin().isTableEnabled(tablename)) {
try {
if (System.currentTimeMillis() > endTime) {
fail("Failed to enable table " + tablename + " after waiting for 60 sec");
}
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
fail("Interrupted when waiting table " + tablename + " to be enabled");
}
}
return tbl;
}