@Test
  public void testFindMemStoresEligibleForFlush() throws Exception {
    LOG.debug("testFindMemStoresEligibleForFlush");
    Configuration conf1 = HBaseConfiguration.create(CONF);
    conf1.setInt("hbase.regionserver.maxlogs", 1);
    try (AbstractFSWAL<?> wal = newWAL(FS, CommonFSUtils.getWALRootDir(conf1), DIR.toString(),
      HConstants.HREGION_OLDLOGDIR_NAME, conf1, null, true, null, null)) {
      testFindMemStoresEligibleForFlush(wal);
    }

  }
On rolling a wal after reaching the threshold, {@link WAL#rollWriter()} returns the list of
regions which should be flushed in order to archive the oldest wal file.
<p>
This method tests this behavior by inserting edits and rolling the wal enough times to reach
the max number of logs threshold. It checks whether we get the "right regions and stores" for
flush on rolling the wal.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestFSWAL.java