private void waitForRSShutdownToStartAndFinish(MasterThread activeMaster, ServerName serverName)
    throws InterruptedException, IOException {
    ServerManager sm = activeMaster.getMaster().getServerManager();
    // First wait for it to be in dead list
    while (!sm.getDeadServers().isDeadServer(serverName)) {
      log("Waiting for [" + serverName + "] to be listed as dead in master");
      Thread.sleep(1);
    }
    log(
      "Server [" + serverName + "] marked as dead, waiting for it to " + "finish dead processing");

    TEST_UTIL.waitFor(60000, () -> isDeadServerSCPExecuted(serverName));

    while (sm.areDeadServersInProgress()) {
      log("Server [" + serverName + "] still being processed, waiting");
      Thread.sleep(100);
    }
    log("Server [" + serverName + "] done with server shutdown processing");
  }
Checks if the SCP of specific dead server has been executed.
@return true if the SCP of specific serverName has been executed, false if not
hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java