public boolean isCheckpointPending() {
        return !pendingCheckpoints.isEmpty();
    }
@Test
    void testNoFastPathWithChannelFinishedDuringCheckpointsCancel() throws Exception {
        BufferOrEvent[] sequence = {
            createBarrier(1, 0, 0), createEndOfPartition(0), createCancellationBarrier(1, 1)
        };

        ValidatingCheckpointHandler checkpointHandler = new ValidatingCheckpointHandler();
        inputGate = createCheckpointedInputGate(2, sequence, checkpointHandler);

        for (BufferOrEvent boe : sequence) {
            assertThat(inputGate.pollNext()).hasValue(boe);
        }

        assertThat(checkpointHandler.getLastCanceledCheckpointId()).isOne();
        // If go with the fast path, the pending checkpoint would not be removed normally.
        assertThat(inputGate.getCheckpointBarrierHandler().isCheckpointPending()).isFalse();
    }