@Test
  public void testConcurrentClearAndRegionDestroyBug() {
    DiskRegionProperties p = new DiskRegionProperties();
    p.setMaxOplogSize(10000);
    p.setOverflow(false);
    p.setSynchronous(true);
    p.setOverFlowCapacity(5);
    p.setRolling(true);
    byte[] val = new byte[8000];
    region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, p, Scope.LOCAL);
    region.put("key1", val);
    DiskStoreImpl dimpl = ((LocalRegion) region).getDiskStore();
    LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = true;
    final Thread th = new Thread(() -> region.destroyRegion());

    DiskStoreImpl.DEBUG_DELAY_JOINING_WITH_COMPACTOR = 8000;
    CacheObserver old = CacheObserverHolder.setInstance(new CacheObserverAdapter() {
      boolean skip = false;

      @Override
      public void beforeStoppingCompactor() {
        if (!skip) {
          skip = true;
          th.setPriority(9);
          th.start();
          Thread.yield();
        }
      }

    }

    );

    region.clear();
    ThreadUtils.join(th, 20 * 1000);
    LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false;
    DiskStoreImpl.DEBUG_DELAY_JOINING_WITH_COMPACTOR = 500;
    CacheObserverHolder.setInstance(old);
  }
Bug Test for bug # 35139. This bug was occuring because a clear & region destroy operation
occurred near concurrently. The region destroy operation notified the roller thread to stop &
then it joined with the roller . But by that time clear operation created a new instance of
roller thread ( because a clear operation stop/starts the roller) & the destroy operation
actually joined with the new thread ( different from the one on which notification was issued
to exit).
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/ConcurrentRegionOperationsJUnitTest.java