@Test
  public void testCompareByMaxModsFileSize()
      throws InterruptedException, IllegalPathException, IOException {
    for (int i = 0; i < 100; ++i) {
      List<TsFileResource> resources = new ArrayList<>();
      for (int j = i; j < 100; ++j) {
        resources.add(
            new FakedTsFileResource(new File(String.format("%d-%d-0-0.tsfile", i + j, i + j)), j));
      }
      SettleCompactionTask settleTask =
          new SettleCompactionTask(
              0,
              tsFileManager,
              Collections.emptyList(),
              resources,
              true,
              new FastCompactionPerformer(false),
              0);
      compactionTaskQueue.put(settleTask);
    }

    String targetFileName = "101-101-0-0.tsfile";
    FakedTsFileResource fakedTsFileResource =
        new FakedTsFileResource(new File(targetFileName), 100);
    fakedTsFileResource
        .getModFileForWrite()
        .write(new TreeDeletionEntry(new MeasurementPath("root.test.d1"), 1));
    compactionTaskQueue.put(
        new SettleCompactionTask(
            0,
            tsFileManager,
            Collections.emptyList(),
            Collections.singletonList(fakedTsFileResource),
            true,
            new FastCompactionPerformer(false),
            0));
    SettleCompactionTask task = (SettleCompactionTask) compactionTaskQueue.take();
    Assert.assertEquals(targetFileName, task.getPartiallyDirtyFiles().get(0).getTsFile().getName());
    fakedTsFileResource.removeModFile();
  }
Test the comparation of cross space compaction task
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/CompactionTaskComparatorTest.java