@Test
  public void testChannelRecoversFromWriteFailureRepeatedRetriesDuringFlush() throws Exception {
    region = DiskRegionHelperFactory.getSyncOverFlowAndPersistRegion(cache, null);
    DiskRegion dr = ((LocalRegion) region).getDiskRegion();
    Oplog[] oplogs = dr.getDiskStore().getPersistentOplogs().getAllOplogs();
    assertNotNull("Unexpected null Oplog[] for " + dr.getName(), oplogs);
    assertNotNull("Unexpected null Oplog", oplogs[0]);

    doChannelFlushWithFailures(oplogs, 3 /* write failures */);
  }
This method tries to write half of the byte buffer to the channel.
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/OplogFlushTest.java