public void commitPartitions() throws Exception {
        commitPartitions((subtaskIndex, attemptNumber) -> true);
    }
@Test
    void testPartition() throws Exception {
        FileSystemCommitter committer =
                new FileSystemCommitter(
                        fileSystemFactory,
                        metaStoreFactory,
                        true,
                        new Path(path.toString()),
                        2,
                        false,
                        identifier,
                        new LinkedHashMap<>(),
                        policies);

        createFile(path, "task-1-attempt-0/p1=0/p2=0/", "f1", "f2");
        createFile(path, "task-2-attempt-0/p1=0/p2=0/", "f3");
        createFile(path, "task-2-attempt-0/p1=0/p2=1/", "f4");
        committer.commitPartitions();
        assertThat(new File(outputPath.toFile(), "p1=0/p2=0/f1")).exists();
        assertThat(new File(outputPath.toFile(), "p1=0/p2=0/f2")).exists();
        assertThat(new File(outputPath.toFile(), "p1=0/p2=0/f3")).exists();
        assertThat(new File(outputPath.toFile(), "p1=0/p2=0/" + SUCCESS_FILE_NAME)).exists();
        assertThat(new File(outputPath.toFile(), "p1=0/p2=1/f4")).exists();
        assertThat(new File(outputPath.toFile(), "p1=0/p2=1/" + SUCCESS_FILE_NAME)).exists();

        createFile(path, "task-2-attempt-0/p1=0/p2=1/", "f5");
        committer.commitPartitions();
        assertThat(new File(outputPath.toFile(), "p1=0/p2=0/f1")).exists();
        assertThat(new File(outputPath.toFile(), "p1=0/p2=0/f2")).exists();
        assertThat(new File(outputPath.toFile(), "p1=0/p2=0/f3")).exists();
        assertThat(new File(outputPath.toFile(), "p1=0/p2=0/" + SUCCESS_FILE_NAME)).exists();
        assertThat(new File(outputPath.toFile(), "p1=0/p2=1/f5")).exists();
        assertThat(new File(outputPath.toFile(), "p1=0/p2=1/" + SUCCESS_FILE_NAME)).exists();

        committer =
                new FileSystemCommitter(
                        fileSystemFactory,
                        metaStoreFactory,
                        false,
                        new Path(path.toString()),
                        2,
                        false,
                        identifier,
                        new LinkedHashMap<>(),
                        policies);
        createFile(path, "task-2-attempt-0/p1=0/p2=1/", "f6");
        committer.commitPartitions();
        assertThat(new File(outputPath.toFile(), "p1=0/p2=1/f5")).exists();
        assertThat(new File(outputPath.toFile(), "p1=0/p2=1/f6")).exists();
        assertThat(new File(outputPath.toFile(), "p1=0/p2=1/" + SUCCESS_FILE_NAME)).exists();
    }