@Test
  public void testNoTimeoutWaitForMeta() throws IOException, InterruptedException, KeeperException {
    ServerName hsa = MetaTableLocator.getMetaRegionLocation(watcher);
    assertNull(hsa);

    // Now test waiting on meta location getting set.
    Thread t = new WaitOnMetaThread();
    startWaitAliveThenWaitItLives(t, 1);
    // Set a meta location.
    MetaTableLocator.setMetaLocation(this.watcher, SN, RegionState.State.OPEN);
    hsa = SN;
    // Join the thread... should exit shortly.
    t.join();
    // Now meta is available.
    assertTrue(MetaTableLocator.getMetaRegionLocation(watcher).equals(hsa));
  }
Test waiting on meat w/ no timeout specified.
hbase-server/src/test/java/org/apache/hadoop/hbase/TestMetaTableLocator.java