@Test
  public void testSingleDirectorySizeViolation() {
    DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
    diskRegionProperties.setRegionName(regionName);
    diskRegionProperties.setDiskDirsAndSizes(new File[] {diskDirs[0]}, new int[] {2048});
    diskRegionProperties.setMaxOplogSize(2097152);
    diskRegionProperties.setRolling(false);

    DiskStoreFactory diskStoreFactory = toDiskStoreFactory(diskRegionProperties);

    createDiskStoreWithSizeInBytes(diskStoreName, diskStoreFactory);

    Region<String, byte[]> region =
        createRegion(regionName, diskStoreName, true, true, false, false, 0);

    Puts puts = new Puts(region);
    puts.performPuts();

    assertThat(puts.putSuccessful(0)).as(" first put did not succeed").isTrue();
    assertThat(puts.putSuccessful(1)).as(" second put should have failed").isFalse();
    assertThat(puts.putSuccessful(2)).as(" third put should have failed").isFalse();

    assertThat(puts.diskAccessExceptionOccurred())
        .as(" Exception was supposed to occur but did not occur").isTrue();

    verifyClosedDueToDiskAccessException(region);
  }
Regression test for TRAC #42464: overfilling disk directory causes rampant oplog creation

<p>
When max-dir-size is exceeded and compaction is enabled we allow oplogs to keep getting
created. Make sure that when they do they do not keep putting one op per oplog (which is caused
by bug 42464).
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegionJUnitTest.java