Github user zentol commented on a diff in the pull request:
https://github.com/apache/flink/pull/6338#discussion_r202604951
--- Diff:
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/TestInputChannel.java
---
@@ -125,4 +111,79 @@ public InputChannel getInputChannel() {
return mocks;
}
+
+ interface BufferAvailabilityProvider {
+ Optional<BufferAndAvailability> getBufferAvailability() throws
IOException, InterruptedException;
+ }
+
+ class MockInputChannel extends InputChannel {
+
+ MockInputChannel(
+ SingleInputGate inputGate,
+ int channelIndex) {
+ super(inputGate, channelIndex, new ResultPartitionID(),
0, 0, new SimpleCounter());
+ }
+
+ private final Queue<BufferAvailabilityProvider> buffers = new
ConcurrentLinkedQueue<>();
+
+ private BufferAvailabilityProvider lastProvider = null;
--- End diff --
move fields above constructor
---