[ 
https://issues.apache.org/jira/browse/HBASE-17806?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15932243#comment-15932243
 ] 

Guangxu Cheng commented on HBASE-17806:
---------------------------------------

{code}
   //test fail bogus server move
    try {
      
rsGroupAdmin.moveServersAndTables(Sets.newHashSet(Address.fromString("foo:9999")),
              Sets.newHashSet(tableName), newGroup.getName());
      fail("Bogus servers shouldn't have been successfully moved.");
    } catch(IOException ex) {
      String exp = "Source RSGroup for server foo:9999 does not exist.";
      String msg = "Expected '" + exp + "' in exception message: ";
      assertTrue(msg + " " + ex.getMessage(), ex.getMessage().contains(exp));
    }

    //test fail server move
    try {
      
rsGroupAdmin.moveServersAndTables(Sets.newHashSet(targetServer.getAddress()),
              Sets.newHashSet(tableName), RSGroupInfo.DEFAULT_GROUP);
      fail("servers shouldn't have been successfully moved.");
    } catch(IOException ex) {
      String exp = "Target RSGroup " + RSGroupInfo.DEFAULT_GROUP +
              " is same as source " + RSGroupInfo.DEFAULT_GROUP + " RSGroup.";
      String msg = "Expected '" + exp + "' in exception message: ";
      assertTrue(msg + " " + ex.getMessage(), ex.getMessage().contains(exp));
    }

    //verify default group info
    Assert.assertEquals(3,
            
rsGroupAdmin.getRSGroupInfo(RSGroupInfo.DEFAULT_GROUP).getServers().size());
    Assert.assertEquals(4,
            
rsGroupAdmin.getRSGroupInfo(RSGroupInfo.DEFAULT_GROUP).getTables().size());
{code}

I got the full log from TEST-org.apache.hadoop.hbase.rsgroup.TestRSGroups.xml.
In the process of testing the scenario where servers and tables movement fails, 
there is no update group information, which is as expected.
So I think that in the initialization default group, the group has five tables.
Before testing the scenario, we can get the tales' size by 
rsGroupAdmin.getRSGroupInfo(RSGroupInfo.DEFAULT_GROUP).getTables().size().

> TestRSGroups#testMoveServersAndTables is flaky in master branch
> ---------------------------------------------------------------
>
>                 Key: HBASE-17806
>                 URL: https://issues.apache.org/jira/browse/HBASE-17806
>             Project: HBase
>          Issue Type: Test
>            Reporter: Ted Yu
>
> According to https://builds.apache.org/job/HBASE-Flaky-Tests , 
> TestRSGroups#testMoveServersAndTables is the top flaky test.
> Recent test failure:
> https://builds.apache.org/job/HBASE-Flaky-Tests/14062/testReport/junit/org.apache.hadoop.hbase.rsgroup/TestRSGroups/testMoveServersAndTables/
> {code}
> java.lang.AssertionError: expected:<4> but was:<5>
>       at org.junit.Assert.fail(Assert.java:88)
>       at org.junit.Assert.failNotEquals(Assert.java:834)
>       at org.junit.Assert.assertEquals(Assert.java:645)
>       at org.junit.Assert.assertEquals(Assert.java:631)
>       at 
> org.apache.hadoop.hbase.rsgroup.TestRSGroupsBase.testMoveServersAndTables(TestRSGroupsBase.java:747)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to