@Test
  public void testDeleteInSelection() throws Exception {
    RewriteCrossSpaceCompactionSelector selector =
        new RewriteCrossSpaceCompactionSelector("", "", 0, null, new CompactionScheduleContext());
    AtomicBoolean fail = new AtomicBoolean(false);
    Thread thread1 =
        new Thread(
            () -> {
              try {
                Thread.sleep(1000);
                List<CrossCompactionTaskResource> selected =
                    selector.selectCrossSpaceTask(seqResources, unseqResources);
              } catch (Exception e) {
                logger.error("Exception occurs", e);
                fail.set(true);
              }
            });
    Thread thread2 =
        new Thread(
            () -> {
              if (!seqResources.get(0).remove()) {
                fail.set(true);
              }
              if (!unseqResources.get(0).remove()) {
                fail.set(true);
              }
            });
    thread1.start();
    thread2.start();
    thread1.join();
    thread2.join();
    if (fail.get()) {
      Assert.fail();
    }
  }
5 source seq files: [11,11] [12,12] [13,13] [14,14] [15,15]<br>
4 source unseq files: [7~9] [10~13] [14~16] [17~18]<br>
while the forth seq file is not close.<br>
selected seq file index: 1 2 3 <br>
selected unseq file index: 1 2
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/cross/RewriteCompactionFileSelectorTest.java