You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by vj...@apache.org on 2022/02/11 11:31:45 UTC
[hbase] branch branch-1 updated: HBASE-26752 Fix flappy test TestSimpleRegionNormalizerOnCluster (#4109)
This is an automated email from the ASF dual-hosted git repository.
vjasani pushed a commit to branch branch-1
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-1 by this push:
new 36a16a0 HBASE-26752 Fix flappy test TestSimpleRegionNormalizerOnCluster (#4109)
36a16a0 is described below
commit 36a16a0bc7b59ba5691524f4d9838c2a9990342d
Author: Aman Poonia <am...@gmail.com>
AuthorDate: Fri Feb 11 17:00:47 2022 +0530
HBASE-26752 Fix flappy test TestSimpleRegionNormalizerOnCluster (#4109)
Signed-off-by: Viraj Jasani <vj...@apache.org>
---
.../TestSimpleRegionNormalizerOnCluster.java | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestSimpleRegionNormalizerOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestSimpleRegionNormalizerOnCluster.java
index 0651525..b057827 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestSimpleRegionNormalizerOnCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestSimpleRegionNormalizerOnCluster.java
@@ -211,7 +211,7 @@ public class TestSimpleRegionNormalizerOnCluster {
dropIfExists(TABLENAME);
}
- @Test
+ @Test(timeout = 60000)
public void testMultiTablePlans()
throws IOException, InterruptedException, CoordinatedStateException {
// create 3 tables with regions to be normalized
@@ -241,18 +241,13 @@ public class TestSimpleRegionNormalizerOnCluster {
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)));