zhijiangW commented on a change in pull request #12243: URL: https://github.com/apache/flink/pull/12243#discussion_r427413431
########## File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/io/InputProcessorUtilTest.java ########## @@ -58,4 +79,57 @@ public void testGenerateInputGateToChannelIndexOffsetMap() { assertEquals(0, inputGateToChannelIndexOffsetMap.get(ig1).intValue()); assertEquals(3, inputGateToChannelIndexOffsetMap.get(ig2).intValue()); } + + @Test + public void testCreateCheckpointedMultipleInputGate() throws Exception { + try (CloseableRegistry registry = new CloseableRegistry()) { + MockEnvironment environment = new MockEnvironmentBuilder().build(); + MockStreamTask streamTask = new MockStreamTaskBuilder(environment).build(); + StreamConfig streamConfig = new StreamConfig(environment.getJobConfiguration()); + streamConfig.setCheckpointMode(CheckpointingMode.EXACTLY_ONCE); + streamConfig.setUnalignedCheckpointsEnabled(true); + + // First input gate has index larger than the second + Collection<IndexedInputGate>[] inputGates = new Collection[] { + Collections.singletonList(new MockIndexedInputGate(1, 4)), + Collections.singletonList(new MockIndexedInputGate(0, 2)), + }; + + new MockChannelStateWriter() { Review comment: seems redundant codes `new MockChannelStateWriter()` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org