@Test
  public void testCompareByCompactionTaskType() throws InterruptedException {
    FixedPriorityBlockingQueue<AbstractCompactionTask> candidateCompactionTaskQueue =
        new FixedPriorityBlockingQueue<>(
            IoTDBDescriptor.getInstance().getConfig().getCandidateCompactionTaskQueueSize(),
            new DefaultCompactionTaskComparatorImpl());

    candidateCompactionTaskQueue.put(
        new SettleCompactionTask(
            1,
            tsFileManager,
            Collections.emptyList(),
            Collections.singletonList(
                new FakedTsFileResource(new File(String.format("%d-%d-0-0.tsfile", 1, 1)), 1)),
            true,
            new FastCompactionPerformer(false),
            0));
    candidateCompactionTaskQueue.put(
        new FakedInnerSpaceCompactionTask(
            "fakeSg",
            1,
            tsFileManager,
            true,
            Collections.singletonList(
                new FakedTsFileResource(new File(String.format("%d-%d-0-0.tsfile", 1, 2)), 1)),
            0));
    candidateCompactionTaskQueue.put(
        new SettleCompactionTask(
            1,
            tsFileManager,
            Collections.emptyList(),
            Collections.singletonList(
                new FakedTsFileResource(new File(String.format("%d-%d-0-0.tsfile", 1, 3)), 1)),
            true,
            new FastCompactionPerformer(false),
            0));

    Assert.assertEquals(
        candidateCompactionTaskQueue.take().getCompactionTaskType(), CompactionTaskType.SETTLE);
    Assert.assertEquals(
        candidateCompactionTaskQueue.take().getCompactionTaskType(), CompactionTaskType.SETTLE);
    Assert.assertEquals(
        candidateCompactionTaskQueue.take().getCompactionTaskType(), CompactionTaskType.INNER_SEQ);
  }
Test the comparation of cross space compaction task
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/CompactionTaskComparatorTest.java