private void checkMinLogRolls(final WAL log, final int minRolls) throws Exception {
    final List<Path> paths = new ArrayList<>();
    log.registerWALActionsListener(new WALActionsListener() {
      @Override
      public void postLogRoll(Path oldFile, Path newFile) {
        LOG.debug("postLogRoll: oldFile=" + oldFile + " newFile=" + newFile);
        paths.add(newFile);
      }
    });

    // Sleep until we should get at least min-LogRoll events
    long wtime = EnvironmentEdgeManager.currentTime();
    Thread.sleep((minRolls + 1) * LOG_ROLL_PERIOD);
    // Do some extra sleep in case the machine is slow,
    // and the log-roll is not triggered exactly on LOG_ROLL_PERIOD.
    final int NUM_RETRIES = 1 + 8 * (minRolls - paths.size());
    for (int retry = 0; paths.size() < minRolls && retry < NUM_RETRIES; ++retry) {
      Thread.sleep(LOG_ROLL_PERIOD / 4);
    }
    wtime = EnvironmentEdgeManager.currentTime() - wtime;
    LOG.info(String.format("got %d rolls after %dms (%dms each) - expected at least %d rolls",
      paths.size(), wtime, wtime / paths.size(), minRolls));
    assertFalse(paths.size() < minRolls);
  }
Tests that the LogRoller perform the roll with some data in the log
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRollPeriod.java