3939import org .apache .hadoop .hbase .client .Table ;
4040import org .apache .hadoop .hbase .client .TableDescriptor ;
4141import org .apache .hadoop .hbase .client .TableDescriptorBuilder ;
42+ import org .apache .hadoop .hbase .master .procedure .ServerCrashProcedure ;
4243import org .apache .hadoop .hbase .net .Address ;
43- import org .apache .hadoop .hbase .testclassification .MediumTests ;
44+ import org .apache .hadoop .hbase .testclassification .LargeTests ;
4445import org .apache .hadoop .hbase .util .Bytes ;
4546import org .apache .hadoop .hbase .util .JVMClusterUtil ;
4647import org .apache .hadoop .hbase .util .VersionInfo ;
5657
5758import org .apache .hbase .thirdparty .com .google .common .collect .Sets ;
5859
59- @ Category ({ MediumTests .class })
60+ @ Category ({ LargeTests .class })
6061public 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