HBASE-17806 TestRSGroups#testMoveServersAndTables is flaky in master branch (Guangxu Cheng)

This commit is contained in:
tedyu 2017-03-20 09:26:34 -07:00
parent 5b4bb8217d
commit 4088f822a4
2 changed files with 12 additions and 2 deletions

View File

@ -132,6 +132,9 @@ public class RSGroupInfo {
sb.append(", ");
sb.append(" Servers:");
sb.append(this.servers);
sb.append(", ");
sb.append(" Tables:");
sb.append(this.tables);
return sb.toString();
}

View File

@ -694,6 +694,7 @@ public abstract class TestRSGroupsBase {
@Test
public void testMoveServersAndTables() throws Exception {
LOG.info("testMoveServersAndTables");
final RSGroupInfo newGroup = addGroup(getGroupName(name.getMethodName()), 1);
//create table
final byte[] familyNameBytes = Bytes.toBytes("f");
@ -718,6 +719,12 @@ public abstract class TestRSGroupsBase {
}
}
LOG.debug("Print group info : " + rsGroupAdmin.listRSGroups());
int oldDefaultGroupServerSize =
rsGroupAdmin.getRSGroupInfo(RSGroupInfo.DEFAULT_GROUP).getServers().size();
int oldDefaultGroupTableSize =
rsGroupAdmin.getRSGroupInfo(RSGroupInfo.DEFAULT_GROUP).getTables().size();
//test fail bogus server move
try {
rsGroupAdmin.moveServersAndTables(Sets.newHashSet(Address.fromString("foo:9999")),
@ -742,9 +749,9 @@ public abstract class TestRSGroupsBase {
}
//verify default group info
Assert.assertEquals(3,
Assert.assertEquals(oldDefaultGroupServerSize,
rsGroupAdmin.getRSGroupInfo(RSGroupInfo.DEFAULT_GROUP).getServers().size());
Assert.assertEquals(4,
Assert.assertEquals(oldDefaultGroupTableSize,
rsGroupAdmin.getRSGroupInfo(RSGroupInfo.DEFAULT_GROUP).getTables().size());
//verify new group info