@Test
  public void testBrokenBootstrapNodes() throws Exception {
    Configuration conf = new Configuration(UTIL.getConfiguration());
    String currentMasterAddrs = Preconditions.checkNotNull(conf.get(HConstants.MASTER_ADDRS_KEY));
    HMaster activeMaster = UTIL.getHBaseCluster().getMaster();
    String clusterId = activeMaster.getClusterId();
    // Add a non-working master
    ServerName badServer = ServerName.valueOf("localhost", 1234, -1);
    conf.set(RpcConnectionRegistry.BOOTSTRAP_NODES, badServer.toShortString());
    // only a bad server, the request should fail
    try (RpcConnectionRegistry reg = new RpcConnectionRegistry(conf, User.getCurrent())) {
      assertThrows(IOException.class, () -> reg.getParsedServers());
    }

    conf.set(RpcConnectionRegistry.BOOTSTRAP_NODES,
      badServer.toShortString() + ", " + currentMasterAddrs);
    // we will choose bootstrap node randomly so here we need to test it multiple times to make sure
    // that we can skip the broken node
    for (int i = 0; i < 10; i++) {
      try (RpcConnectionRegistry reg = new RpcConnectionRegistry(conf, User.getCurrent())) {
        assertEquals(clusterId, reg.getClusterId().get());
      }
    }
  }
Make sure that we can create the RpcClient when there are broken servers in the bootstrap nodes
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRpcConnectionRegistry.java