zhijiangW commented on a change in pull request #11351: [FLINK-16404][runtime] 
Avoid caching buffers for blocked input channels before barrier alignment
URL: https://github.com/apache/flink/pull/11351#discussion_r409264636
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/PartitionRequestQueueTest.java
 ##########
 @@ -381,6 +387,47 @@ public void testEnqueueReaderByNotifyingBufferAndCredit() 
throws Exception {
                assertNull(channel.readOutbound());
        }
 
+       /**
+        * Tests {@link 
PartitionRequestQueue#enqueueAvailableReader(NetworkSequenceViewReader)},
+        * verifying the reader would be enqueued in the pipeline after 
resuming data consumption if there
+        * are credit and data available.
+        */
+       @Test
+       public void testEnqueueReaderByResumingConsumption() throws Exception {
+               PipelinedSubpartition subpartition = 
PipelinedSubpartitionTest.createPipelinedSubpartition();
+               subpartition.add(createEventBufferConsumer(4096, 
Buffer.DataType.EXACTLY_ONCE_CHECKPOINT_BARRIER));
+               subpartition.add(createEventBufferConsumer(4096, 
Buffer.DataType.DATA_BUFFER));
+
+               BufferAvailabilityListener bufferAvailabilityListener = new 
NoOpBufferAvailablityListener();
+               PipelinedSubpartitionView view = 
subpartition.createReadView(bufferAvailabilityListener);
+               ResultPartitionProvider partitionProvider = (partitionId, 
index, availabilityListener) -> view;
+
+               InputChannelID receiverId = new InputChannelID();
+               PartitionRequestQueue queue = new PartitionRequestQueue();
+               CreditBasedSequenceNumberingViewReader reader = new 
CreditBasedSequenceNumberingViewReader(receiverId, 0, queue);
+               EmbeddedChannel channel = new EmbeddedChannel(queue);
+
+               reader.requestSubpartitionView(partitionProvider, new 
ResultPartitionID(), 0);
+               queue.notifyReaderCreated(reader);
+               // we have adequate credits
 
 Review comment:
   typo `adequate`?

----------------------------------------------------------------
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

Reply via email to