public void assertRegionOnServer(final RegionInfo hri, final ServerName server,
    final long timeout) throws IOException, InterruptedException {
    long timeoutTime = EnvironmentEdgeManager.currentTime() + timeout;
    while (true) {
      List<RegionInfo> regions = getAdmin().getRegions(server);
      if (regions.stream().anyMatch(r -> RegionInfo.COMPARATOR.compare(r, hri) == 0)) return;
      long now = EnvironmentEdgeManager.currentTime();
      if (now > timeoutTime) break;
      Thread.sleep(10);
    }
    fail("Could not find region " + hri.getRegionNameAsString() + " on server " + server);
  }
Due to async racing issue, a region may not be in the online region list of a region server
yet, after the assignment znode is deleted and the new assignment is recorded in master.
hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java