@Override
      public void goingToFlush() {
        if (!alreadyComeHere) {
          try {
            new Close(region).start();
            try {
              Thread.sleep(3000);
            } catch (InterruptedException ok) {
              // this is ok; the async writer thread is interrupted during shutdown
              Thread.currentThread().interrupt();
            }
          } catch (Exception e) {
            logWriter.error("Exception occurred", e);
            fail("Exception occurred when it was not supposed to occur");
          }
        }
        alreadyComeHere = true;
      }
region is closed before going to be flushed The region is going to be closed in a separate
thread. A 3000 ms wait is done to ensure that the separate thread has successfully closed the
region
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/ConcurrentFlushingAndRegionOperationsJUnitTest.java