@Test
  public void testCompareByTimePartitionWithInnerSpaceCompaction() throws InterruptedException {
    List<TsFileResource> resources1 = new ArrayList<>();
    for (int i = 0; i < 10; i++) {
      resources1.add(
          new FakedTsFileResource(new File(String.format("%d-%d-0-0.tsfile", i, i)), 10));
    }
    FixedPriorityBlockingQueue<AbstractCompactionTask> candidateCompactionTaskQueue =
        new FixedPriorityBlockingQueue<>(
            IoTDBDescriptor.getInstance().getConfig().getCandidateCompactionTaskQueueSize(),
            new DefaultCompactionTaskComparatorImpl());
    for (int i = 0; i < 10; i++) {
      FakedInnerSpaceCompactionTask task =
          new FakedInnerSpaceCompactionTask("fakeSg", i, tsFileManager, true, resources1, 0);
      candidateCompactionTaskQueue.put(task);
    }

    for (int i = 9; i >= 0; i--) {
      Assert.assertEquals(candidateCompactionTaskQueue.take().getTimePartition(), i);
    }
  }
Test the comparation of cross space compaction task
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/CompactionTaskComparatorTest.java