virajjasani commented on a change in pull request #1435: HBASE-24112 [RSGroup] 
Support renaming rsgroup
URL: https://github.com/apache/hbase/pull/1435#discussion_r403716631
 
 

 ##########
 File path: 
hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsAdmin1.java
 ##########
 @@ -468,4 +468,31 @@ public boolean evaluate() throws Exception {
     // Cleanup
     TEST_UTIL.deleteTable(tn1);
   }
+
+  @Test
+  public void testRenameRSGroup() throws Exception {
+    // Add rsgroup, and assign 2 servers and a table to it.
+    RSGroupInfo oldgroup = addGroup("oldgroup", 2);
+    TableName tb = TableName.valueOf("testRename");
+    TEST_UTIL.createTable(tb, "tr");
+    ADMIN.setRSGroup(Sets.newHashSet(tb), oldgroup.getName());
+    Thread.sleep(500);
 
 Review comment:
   Instead of sleep(), we can use `HBASE_TESTING_UTILITY.waitFor`:
   e.g.
   ```
   HBASE_TESTING_UTILITY.waitFor(1000,
         () -> {
             oldgroup = ADMIN.getRSGroup(oldgroup.getName());
             return oldgroup.getServers().size() == 2 && 
ADMIN.getRSGroup(tb).getName().equals(oldgroup.getName());
         });
   ```
   This way we will ensure, we wait for specific period of time until our 
predicate returns true.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to