@Test
  public void closeDiskStoreDuringDestroy() throws InterruptedException {
    testRegion.put("existingKey", "value");
    testRegion.getAttributesMutator().setCacheWriter(blockingWriter);
    Future<Void> asyncDestroy = CompletableFuture.runAsync(() -> testRegion.remove("existingKey"));
    blockingWriter.awaitDestroyInProgress();
    cache.closeDiskStores();
    blockingWriter.allowDestroys();
    assertThatThrownBy(asyncDestroy::get).hasRootCauseInstanceOf(CacheClosedException.class)
        .hasMessageContaining("The disk store is closed");
  }
Tests the basic use cases for PR persistence.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PersistPRKRFIntegrationTest.java