Skip to content

Commit c8c7aec

Browse files
committed
HBASE-23655 Fix flaky TestRSGroupsKillRS: should wait the SCP to finish (#996)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
1 parent 54af279 commit c8c7aec

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsKillRS.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@
3939
import org.apache.hadoop.hbase.client.Table;
4040
import org.apache.hadoop.hbase.client.TableDescriptor;
4141
import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
42+
import org.apache.hadoop.hbase.master.procedure.ServerCrashProcedure;
4243
import org.apache.hadoop.hbase.net.Address;
43-
import org.apache.hadoop.hbase.testclassification.MediumTests;
44+
import org.apache.hadoop.hbase.testclassification.LargeTests;
4445
import org.apache.hadoop.hbase.util.Bytes;
4546
import org.apache.hadoop.hbase.util.JVMClusterUtil;
4647
import org.apache.hadoop.hbase.util.VersionInfo;
@@ -56,7 +57,7 @@
5657

5758
import org.apache.hbase.thirdparty.com.google.common.collect.Sets;
5859

59-
@Category({ MediumTests.class })
60+
@Category({ LargeTests.class })
6061
public class TestRSGroupsKillRS extends TestRSGroupsBase {
6162

6263
@ClassRule
@@ -237,12 +238,11 @@ public void testLowerMetaGroupVersion() throws Exception{
237238
addGroup(groupName, groupRSCount);
238239

239240
// move hbase:meta to meta_group
240-
tableName = TableName.META_TABLE_NAME;
241241
Set<TableName> toAddTables = new HashSet<>();
242-
toAddTables.add(tableName);
242+
toAddTables.add(TableName.META_TABLE_NAME);
243243
rsGroupAdmin.moveTables(toAddTables, groupName);
244-
assertTrue(rsGroupAdmin.getRSGroupInfo(groupName).getTables().contains(tableName));
245-
TEST_UTIL.waitTableAvailable(tableName, 30000);
244+
assertTrue(
245+
rsGroupAdmin.getRSGroupInfo(groupName).getTables().contains(TableName.META_TABLE_NAME));
246246

247247
// restart the regionserver in meta_group, and lower its version
248248
String originVersion = "";
@@ -268,7 +268,9 @@ public void testLowerMetaGroupVersion() throws Exception{
268268
assertTrue(VersionInfo.compareVersion(originVersion,
269269
master.getRegionServerVersion(getServerName(servers.iterator().next()))) > 0);
270270
LOG.debug("wait for META assigned...");
271-
TEST_UTIL.waitTableAvailable(tableName, 30000);
271+
// SCP finished, which means all regions assigned too.
272+
TEST_UTIL.waitFor(60000, () -> !TEST_UTIL.getHBaseCluster().getMaster().getProcedures().stream()
273+
.filter(p -> (p instanceof ServerCrashProcedure)).findAny().isPresent());
272274
}
273275

274276
private static void setFinalStatic(Field field, Object newValue) throws Exception {

0 commit comments

Comments
 (0)