zhijiangW commented on a change in pull request #8416: [FLINK-12331] Introduce partition/gate setup to decouple task registration with NetworkEnvironment URL: https://github.com/apache/flink/pull/8416#discussion_r283183410
########## File path: flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGateTest.java ########## @@ -415,16 +395,19 @@ public void testRequestBuffersWithRemoteInputChannel() throws Exception { final NetworkEnvironment network = createNetworkEnvironment(); try { - final ResultPartitionID resultPartitionId = new ResultPartitionID(); - final ConnectionID connectionId = new ConnectionID(new InetSocketAddress("localhost", 5000), 0); - addRemoteInputChannel(network, inputGate, connectionId, resultPartitionId, 0); + RemoteInputChannel remoteFromUnknown = + InputChannelBuilder.newBuilder() + .setupFromNetworkEnvironment(network) + .buildUnknown(inputGate) + .toRemoteInputChannel(InputChannelBuilder.STUB_CONNECTION_ID); + IntermediateResultPartitionID resultPartitionId = remoteFromUnknown.getPartitionId().getPartitionId(); + inputGate.setInputChannel(resultPartitionId, remoteFromUnknown); network.setupInputGate(inputGate); NetworkBufferPool bufferPool = network.getNetworkBufferPool(); if (enableCreditBasedFlowControl) { - RemoteInputChannel remote = (RemoteInputChannel) inputGate.getInputChannels() - .get(resultPartitionId.getPartitionId()); + RemoteInputChannel remote = (RemoteInputChannel) inputGate.getInputChannels().get(resultPartitionId); Review comment: Use the previous `remoteFromUnknown` directly, so `IntermediateResultPartitionID resultPartitionId = remoteFromUnknown.getPartitionId().getPartitionId()` could also be removed. ---------------------------------------------------------------- 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 With regards, Apache Git Services