Skip to content

Commit 21ebfb9

Browse files
committed
HBASE-23655 Fix flaky TestRSGroupsKillRS: should wait the SCP to finish
1 parent 6d22b7c commit 21ebfb9

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

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

Lines changed: 10 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,12 @@ 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));
246+
TEST_UTIL.waitUntilAllRegionsAssigned(TableName.META_TABLE_NAME, 30000);
246247

247248
// restart the regionserver in meta_group, and lower its version
248249
String originVersion = "";
@@ -268,7 +269,9 @@ public void testLowerMetaGroupVersion() throws Exception{
268269
assertTrue(VersionInfo.compareVersion(originVersion,
269270
master.getRegionServerVersion(getServerName(servers.iterator().next()))) > 0);
270271
LOG.debug("wait for META assigned...");
271-
TEST_UTIL.waitTableAvailable(tableName, 30000);
272+
TEST_UTIL.waitFor(60000, () -> !TEST_UTIL.getHBaseCluster().getMaster().getProcedures().stream()
273+
.filter(p -> (p instanceof ServerCrashProcedure)).findAny().isPresent());
274+
TEST_UTIL.waitUntilAllRegionsAssigned(TableName.META_TABLE_NAME, 60000);
272275
}
273276

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

0 commit comments

Comments
 (0)