Github user NicoK commented on a diff in the pull request: https://github.com/apache/flink/pull/4485#discussion_r136022209 --- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGateTest.java --- @@ -372,6 +375,52 @@ public void testRequestBackoffConfiguration() throws Exception { } } + /** + * Tests that input gate requests and assigns network buffers for remote input channel, and triggers + * this process after unknown input channel updates to remote input channel. + */ + @Test + public void testRequestBuffersForInputChannel() throws Exception { + final TaskIOMetricGroup metrics = new UnregisteredTaskMetricsGroup.DummyTaskIOMetricGroup(); + final SingleInputGate inputGate = new SingleInputGate( + "t1", + new JobID(), + new IntermediateDataSetID(), + ResultPartitionType.PIPELINED_CREDIT_BASED, + 0, + 1, + mock(TaskActions.class), + metrics); + RemoteInputChannel remote = mock(RemoteInputChannel.class); + inputGate.setInputChannel(new IntermediateResultPartitionID(), remote); + + final int buffersPerChannel = 2; + NetworkBufferPool network = mock(NetworkBufferPool.class); + inputGate.assignExclusiveSegments(network, buffersPerChannel); + + verify(network, times(1)).requestMemorySegments(buffersPerChannel); + verify(remote, times(1)).assignExclusiveSegments(anyList()); --- End diff -- `verify(remote, times(1)).assignExclusiveSegments(anyListOf(MemorySegment.class));`
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---