Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public void testRegionNormalizationMergeOnCluster() throws Exception {
dropIfExists(TABLENAME);
}

@Test
@Test(timeout = 60000)
public void testMultiTablePlans()
throws IOException, InterruptedException, CoordinatedStateException {
// create 3 tables with regions to be normalized
Expand Down Expand Up @@ -241,18 +241,13 @@ public void testMultiTablePlans()
Thread.sleep(5000); // to let region load to update
boolean checkStatus = master.normalizeRegions();
assertTrue(checkStatus);

// checking for table 0 to check if normalizer has been triggered or not
while (MetaTableAccessor.getRegionCount(TEST_UTIL.getConnection(), tableNames.get(0)) > 4) {
LOG.info("Waiting for normalization merge to complete");
Thread.sleep(100);
}
while (MetaTableAccessor.getRegionCount(TEST_UTIL.getConnection(), tableNames.get(2)) > 4) {
LOG.info("Waiting for normalization merge to complete");
Thread.sleep(100);
}

Thread.sleep(1000);
// this sleeps helps in getting accurate result from MetaTableAccessor.getRegionCount
Thread.sleep(5000);
// something is miss in test. If this test passes that doesnot mean correctness
// but this test failing means there is surely an issue. It happens because the order of table
// normalization is not fix so there are chances that the second table is finished in the end
// which means test will pass even though there is an issue in normalizer.
// Culprit is HMaster code where we call Collections.shuffle(allEnabledTables)
assertEquals(4, MetaTableAccessor.getRegionCount(TEST_UTIL.getConnection(), tableNames.get(0)));
assertEquals(5, MetaTableAccessor.getRegionCount(TEST_UTIL.getConnection(), tableNames.get(1)));
assertEquals(4, MetaTableAccessor.getRegionCount(TEST_UTIL.getConnection(), tableNames.get(2)));
Expand Down