@Test(expected = IOException.class)
  public void testSplitWillFailIfWritingToRegionFails() throws Exception {
    // leave 5th log open so we could append the "trap"
    Writer writer = generateWALs(4);
    useDifferentDFSClient();

    String region = "break";
    Path regiondir = new Path(TABLEDIR, region);
    fs.mkdirs(regiondir);

    InstrumentedLogWriter.activateFailure = false;
    appendEntry(writer, TABLE_NAME, Bytes.toBytes(region), Bytes.toBytes("r" + 999), FAMILY,
      QUALIFIER, VALUE, 0);
    writer.close();

    try {
      InstrumentedLogWriter.activateFailure = true;
      WALSplitter.split(HBASELOGDIR, WALDIR, OLDLOGDIR, fs, conf, wals);
    } catch (IOException e) {
      assertTrue(e.getMessage()
        .contains("This exception is instrumented and should only be thrown for testing"));
      throw e;
    } finally {
      InstrumentedLogWriter.activateFailure = false;
    }
  }
@return set of wal names present prior to split attempt.
@throws IOException if the split process fails
hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALSplit.java