@Test
  public void testStopDuringStart() throws IOException, KeeperException, InterruptedException {
    HMaster master = new HMaster(TESTUTIL.getConfiguration());
    master.start();
    // Immediately have it stop. We used hang in assigning meta.
    master.stopMaster();
    master.join();
  }
Test starting master then stopping it before its fully up.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java