@Test(expected = IOException.class)
  public void testFailedToCreateWALIfParentRenamed()
    throws IOException, CommonFSUtils.StreamLacksCapabilityException {
    final String name = "testFailedToCreateWALIfParentRenamed";
    AbstractFSWAL<?> wal = newWAL(FS, CommonFSUtils.getWALRootDir(CONF), name,
      HConstants.HREGION_OLDLOGDIR_NAME, CONF, null, true, null, null);
    long filenum = EnvironmentEdgeManager.currentTime();
    Path path = wal.computeFilename(filenum);
    wal.createWriterInstance(FS, path);
    Path parent = path.getParent();
    path = wal.computeFilename(filenum + 1);
    Path newPath = new Path(parent.getParent(), parent.getName() + "-splitting");
    FS.rename(parent, newPath);
    wal.createWriterInstance(FS, path);
    fail("It should fail to create the new 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