protected final void waitUntilDeleted(HBaseTestingUtil util, Path remoteWAL) throws Exception {
    MasterFileSystem mfs = util.getMiniHBaseCluster().getMaster().getMasterFileSystem();
    util.waitFor(30000, new ExplainingPredicate<Exception>() {

      @Override
      public boolean evaluate() throws Exception {
        return !mfs.getWALFileSystem().exists(remoteWAL);
      }

      @Override
      public String explainFailure() throws Exception {
        return remoteWAL + " has not been deleted yet";
      }
    });
  }
Base class for testing sync replication.
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/SyncReplicationTestBase.java