pnowojski commented on a change in pull request #8559: [FLINK-12576][Network,
Metrics]Take localInputChannel into account when compute inputQueueLength
URL: https://github.com/apache/flink/pull/8559#discussion_r301998618
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/LocalInputChannelTest.java
##########
@@ -358,6 +361,97 @@ public void testGetNextAfterPartitionReleased() throws
Exception {
assertFalse(channel.getNextBuffer().isPresent());
}
+ @Test
+ public void testQueuedNumberBuffers() throws IOException,
InterruptedException, ExecutionException, TimeoutException {
Review comment:
One thing, that here we are actually testing
`SingleInputGate#getNumberOfQueuedBuffers`, so maybe we should move this test
to `SingleInputGateTest` file.
Secondly I think this test adds unnecessary concurrency. Could it be written
similar to `SingleInputGateTest#testUpdateUnknownInputChannel`, apart from the
`addUnknownInputChannel`? Instead of adding unknown input channels, you could
create one remote and one local input channel directly, then populate them
manually with some data (`RemoteInpuChannel#onBuffer` for the remote one and
`ResultPartition#addBufferConsumer(...)` for the local one). After populating
the channels, you could check the result of
`SingleInputGate#getNumberOfQueuedBuffers`, without any actual data exchange,
no threads, no concurrency no waiting?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services