HBASE-7299 TestMultiParallel fails intermittently in trunk builds (Chunhui)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1426965 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2012-12-30 17:00:53 +00:00
parent 21e5b5200d
commit 8d70de20e0
1 changed files with 14 additions and 1 deletions

View File

@ -65,6 +65,7 @@ public class TestMultiParallel {
UTIL.startMiniCluster(slaves);
HTable t = UTIL.createTable(Bytes.toBytes(TEST_TABLE), Bytes.toBytes(FAMILY));
UTIL.createMultiRegions(t, Bytes.toBytes(FAMILY));
UTIL.waitTableAvailable(Bytes.toBytes(TEST_TABLE), 15 * 1000);
t.close();
}
@ -226,6 +227,11 @@ public class TestMultiParallel {
doTestFlushCommits(true);
}
/**
* Set table auto flush to false and test flushing commits
* @param doAbort true if abort one regionserver in the testing
* @throws Exception
*/
private void doTestFlushCommits(boolean doAbort) throws Exception {
// Load the data
LOG.info("get new table");
@ -242,7 +248,14 @@ public class TestMultiParallel {
table.flushCommits();
if (doAbort) {
LOG.info("Aborted=" + UTIL.getMiniHBaseCluster().abortRegionServer(0));
// If we wait for no regions being online after we abort the server, we
// could ensure the master has re-assigned the regions on killed server
// after writing successfully. It means the server we aborted is dead
// and detected by matser
while (UTIL.getMiniHBaseCluster().getRegionServer(0)
.getNumberOfOnlineRegions() != 0) {
Thread.sleep(10);
}
// try putting more keys after the abort. same key/qual... just validating
// no exceptions thrown
puts = constructPutRequests();