@Test
  public void testLoadRegionFromMetaAfterRegionManuallyAdded() throws Exception {
    try {
      this.util.startMiniCluster();
      final AssignmentManager am = this.util.getHBaseCluster().getMaster().getAssignmentManager();
      final TableName tableName =
        TableName.valueOf("testLoadRegionFromMetaAfterRegionManuallyAdded");
      this.util.createTable(tableName, "f");
      RegionInfo hri = createRegionInfo(tableName, 1);
      assertNull("RegionInfo was just instantiated by the test, but "
        + "shouldn't be in AM regionStates yet.", am.getRegionStates().getRegionState(hri));
      MetaTableAccessor.addRegionsToMeta(this.util.getConnection(), Collections.singletonList(hri),
        1);
      // TODO: is there a race here -- no other thread else will refresh the table states behind
      // the scenes?
      assertNull("RegionInfo was manually added in META, but shouldn't be in AM regionStates yet.",
        am.getRegionStates().getRegionState(hri));
      am.populateRegionStatesFromMeta(hri.getEncodedName());
      assertNotNull(am.getRegionInfo(hri.getRegionName()));
      assertNotNull(am.getRegionInfo(hri.getEncodedName()));
    } finally {
      this.util.killMiniHBaseCluster();
    }
  }
It is possible that when AM send assign meta request to a RS successfully, but RS can not send
back any response, which cause master startup hangs forever
hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManager.java