You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zg...@apache.org on 2020/01/09 11:18:16 UTC
[hbase] branch master updated: HBASE-23655 Fix flaky
TestRSGroupsKillRS: should wait the SCP to finish (#996)
This is an automated email from the ASF dual-hosted git repository.
zghao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/master by this push:
new c8c7aec HBASE-23655 Fix flaky TestRSGroupsKillRS: should wait the SCP to finish (#996)
c8c7aec is described below
commit c8c7aecbee942284ccc54d72794de1ce48d48f05
Author: Guanghao Zhang <zg...@apache.org>
AuthorDate: Thu Jan 9 14:40:01 2020 +0800
HBASE-23655 Fix flaky TestRSGroupsKillRS: should wait the SCP to finish (#996)
Signed-off-by: Duo Zhang <zh...@apache.org>
---
.../apache/hadoop/hbase/rsgroup/TestRSGroupsKillRS.java | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsKillRS.java b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsKillRS.java
index 539f351..6aa3931 100644
--- a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsKillRS.java
+++ b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsKillRS.java
@@ -39,8 +39,9 @@ import org.apache.hadoop.hbase.client.RegionInfo;
import org.apache.hadoop.hbase.client.Table;
import org.apache.hadoop.hbase.client.TableDescriptor;
import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
+import org.apache.hadoop.hbase.master.procedure.ServerCrashProcedure;
import org.apache.hadoop.hbase.net.Address;
-import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.hadoop.hbase.testclassification.LargeTests;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.JVMClusterUtil;
import org.apache.hadoop.hbase.util.VersionInfo;
@@ -56,7 +57,7 @@ import org.slf4j.LoggerFactory;
import org.apache.hbase.thirdparty.com.google.common.collect.Sets;
-@Category({ MediumTests.class })
+@Category({ LargeTests.class })
public class TestRSGroupsKillRS extends TestRSGroupsBase {
@ClassRule
@@ -237,12 +238,11 @@ public class TestRSGroupsKillRS extends TestRSGroupsBase {
addGroup(groupName, groupRSCount);
// move hbase:meta to meta_group
- tableName = TableName.META_TABLE_NAME;
Set<TableName> toAddTables = new HashSet<>();
- toAddTables.add(tableName);
+ toAddTables.add(TableName.META_TABLE_NAME);
rsGroupAdmin.moveTables(toAddTables, groupName);
- assertTrue(rsGroupAdmin.getRSGroupInfo(groupName).getTables().contains(tableName));
- TEST_UTIL.waitTableAvailable(tableName, 30000);
+ assertTrue(
+ rsGroupAdmin.getRSGroupInfo(groupName).getTables().contains(TableName.META_TABLE_NAME));
// restart the regionserver in meta_group, and lower its version
String originVersion = "";
@@ -268,7 +268,9 @@ public class TestRSGroupsKillRS extends TestRSGroupsBase {
assertTrue(VersionInfo.compareVersion(originVersion,
master.getRegionServerVersion(getServerName(servers.iterator().next()))) > 0);
LOG.debug("wait for META assigned...");
- TEST_UTIL.waitTableAvailable(tableName, 30000);
+ // SCP finished, which means all regions assigned too.
+ TEST_UTIL.waitFor(60000, () -> !TEST_UTIL.getHBaseCluster().getMaster().getProcedures().stream()
+ .filter(p -> (p instanceof ServerCrashProcedure)).findAny().isPresent());
}
private static void setFinalStatic(Field field, Object newValue) throws Exception {