@Test
  public void testCloseInterrupt() throws Exception {
    byte[] cf1 = Bytes.toBytes("CF1");
    byte[][] families = { cf1 };
    final int SLEEP_TIME = 10 * 1000;

    Configuration conf = new Configuration(CONF);
    // Enable close thread interrupt and server abort behavior
    conf.setBoolean(HRegion.CLOSE_WAIT_ABORT, true);
    // Speed up the unit test, no need to wait default 10 seconds.
    conf.setInt(HRegion.CLOSE_WAIT_INTERVAL, 1000);
    region = initHRegion(tableName, method, conf, families);

    final CountDownLatch latch = new CountDownLatch(1);
    final AtomicBoolean holderInterrupted = new AtomicBoolean();
    Thread holder = new Thread(new Runnable() {
      @Override
      public void run() {
        try {
          LOG.info("Starting region operation holder");
          region.startRegionOperation(Operation.SCAN);
          latch.countDown();
          try {
            Thread.sleep(SLEEP_TIME);
          } catch (InterruptedException e) {
            LOG.info("Interrupted");
            holderInterrupted.set(true);
          }
        } catch (Exception e) {
          throw new RuntimeException(e);
        } finally {
          try {
            region.closeRegionOperation();
          } catch (IOException e) {
          }
          LOG.info("Stopped region operation holder");
        }
      }
    });

    holder.start();
    latch.await();
    region.close();
    region = null;
    holder.join();

    assertTrue("Region lock holder was not interrupted", holderInterrupted.get());
  }
HStoreForTesting is merely the same as HStore, the difference is in the doCompaction method of
HStoreForTesting there is a checkpoint "hbase.hstore.compaction.complete" which doesn't let
hstore compaction complete. In the former edition, this config is set in HStore class inside
compact method, though this is just for testing, otherwise it doesn't do any help. In
HBASE-8518, we try to get rid of all "hbase.hstore.compaction.complete" config (except for
testing code).
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java