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_r409292900
 
 

 ##########
 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());
+
 
 Review comment:
   Add `Assert.assertEquals(3, ADMIN.getRegionServers(false).size());` for 
paranoid reviewers (cough cough me). 

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