liuml07 commented on a change in pull request #1523: HBASE-24195 : 
Admin.getRegionServers() should return live servers exc…
URL: https://github.com/apache/hbase/pull/1523#discussion_r409298907
 
 

 ##########
 File path: 
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java
 ##########
 @@ -864,4 +865,42 @@ public void testSlowLogResponses() throws Exception {
     Assert.assertEquals(onlineLogRecords.size(), 0);
   }
 
+  @Test
+  public void testGetRegionServers() throws Exception {
+    // get all live server names
+    List<ServerName> serverNames = new 
ArrayList<>(ADMIN.getRegionServers(true));
+    Assert.assertEquals(3, serverNames.size());
+
+    List<ServerName> serversToDecom = new ArrayList<>();
+    ServerName serverToDecommission = serverNames.get(0);
+
+    serversToDecom.add(serverToDecommission);
+    ADMIN.decommissionRegionServers(serversToDecom, false);
+    waitForServerDecom(serverToDecommission, true);
+
+    Assert.assertEquals(2, ADMIN.getRegionServers(true).size());
+
+    ADMIN.recommissionRegionServer(serverToDecommission, 
Collections.emptyList());
+
+    Assert.assertEquals(3, ADMIN.getRegionServers(true).size());
+    waitForServerDecom(serverToDecommission, false);
 
 Review comment:
   I was thinking the assertion `Assert.assertEquals(3, 
ADMIN.getRegionServers(true).size());` should have made sure all RS are fine 
now. I understand in case that is not enough, you explicitly make sure the mini 
cluster is ready for other test cases. OK, good.

----------------------------------------------------------------
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