public static void createTable(HBaseTestingUtil testUtil, TableDescriptor tableDescriptor,
    byte[][] splitKeys) throws Exception {
    // NOTE: We need a latch because admin is not sync,
    // so the postOp coprocessor method may be called after the admin operation returned.
    MasterSyncCoprocessor coproc = testUtil.getHBaseCluster().getMaster().getMasterCoprocessorHost()
      .findCoprocessor(MasterSyncCoprocessor.class);
    coproc.tableCreationLatch = new CountDownLatch(1);
    if (splitKeys != null) {
      admin.createTable(tableDescriptor, splitKeys);
    } else {
      admin.createTable(tableDescriptor);
    }
    coproc.tableCreationLatch.await();
    coproc.tableCreationLatch = null;
    testUtil.waitUntilAllRegionsAssigned(tableDescriptor.getTableName());
  }
Test that use this should have a timeout, because this method could potentially wait forever.
hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java