From 34ebdd6c9dcfcb40ad118e1e4c444e67ba04fe49 Mon Sep 17 00:00:00 2001 From: huaxiangsun Date: Mon, 30 Mar 2020 12:26:10 -0700 Subject: [PATCH] HBASE-24073 [flakey test] client.TestAsyncRegionAdminApi messed up compaction state. (#1387) (#1389) Signed-off-by: Viraj Jasani --- .../hbase/client/TestAsyncRegionAdminApi.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionAdminApi.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionAdminApi.java index 38f19c436dc..4cb1174d1ac 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionAdminApi.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionAdminApi.java @@ -372,7 +372,18 @@ public class TestAsyncRegionAdminApi extends TestAsyncAdminBase { byte[][] families = { family, Bytes.add(family, Bytes.toBytes("2")), Bytes.add(family, Bytes.toBytes("3")) }; createTableWithDefaultConf(tableName, null, families); - loadData(tableName, families, 3000, flushes); + + byte[][] singleFamilyArray = { family }; + + // When singleFamily is true, only load data for the family being tested. This is to avoid + // the case that while major compaction is going on for the family, minor compaction could + // happen for other families at the same time (Two compaction threads long/short), thus + // pollute the compaction and store file numbers for the region. + if (singleFamily) { + loadData(tableName, singleFamilyArray, 3000, flushes); + } else { + loadData(tableName, families, 3000, flushes); + } List regions = new ArrayList<>(); TEST_UTIL