pnowojski commented on a change in pull request #16366:
URL: https://github.com/apache/flink/pull/16366#discussion_r665931019
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/PipelinedSubpartitionWithReadViewTest.java
##########
@@ -487,42 +487,61 @@ private void
testBacklogConsistentWithNumberOfConsumableBuffers(
}
@Test
- public void testBlockedByCheckpointAndResumeConsumption()
- throws IOException, InterruptedException {
+ public void testResumeBlockedSubpartitionWithEvents() throws IOException,
InterruptedException {
blockSubpartitionByCheckpoint(1);
// add an event after subpartition blocked
subpartition.add(createEventBufferConsumer(BUFFER_SIZE,
Buffer.DataType.EVENT_BUFFER));
// no data available notification after adding an event
checkNumNotificationsAndAvailability(1);
+ // Resumption will make the subpartition available.
resumeConsumptionAndCheckAvailability(0, true);
assertNextEvent(readView, BUFFER_SIZE, null, false, 0, false, true);
+ }
- blockSubpartitionByCheckpoint(2);
+ @Test
+ public void testResumeBlockedSubpartitionWithUnfinishedBuffer()
+ throws IOException, InterruptedException {
+ blockSubpartitionByCheckpoint(1);
// add a buffer and flush the subpartition
subpartition.add(createFilledFinishedBufferConsumer(BUFFER_SIZE));
subpartition.flush();
// no data available notification after adding a buffer and flushing
the subpartition
- checkNumNotificationsAndAvailability(2);
+ checkNumNotificationsAndAvailability(1);
- resumeConsumptionAndCheckAvailability(Integer.MAX_VALUE, false);
+ // Resumption will make the subpartition available.
+ resumeConsumptionAndCheckAvailability(Integer.MAX_VALUE, true);
assertNextBuffer(readView, BUFFER_SIZE, false, 0, false, true);
+ }
- blockSubpartitionByCheckpoint(3);
+ @Test
+ public void testResumeBlockedSubpartitionWithFinishedBuffers()
+ throws IOException, InterruptedException {
+ blockSubpartitionByCheckpoint(1);
// add two buffers to the subpartition
subpartition.add(createFilledFinishedBufferConsumer(BUFFER_SIZE));
subpartition.add(createFilledFinishedBufferConsumer(BUFFER_SIZE));
// no data available notification after adding the second buffer
- checkNumNotificationsAndAvailability(3);
+ checkNumNotificationsAndAvailability(1);
+ // Resumption will make the subpartition available.
resumeConsumptionAndCheckAvailability(Integer.MAX_VALUE, true);
assertNextBuffer(readView, BUFFER_SIZE, false, 0, false, true);
assertNextBuffer(readView, BUFFER_SIZE, false, 0, false, true);
}
+ @Test
+ public void testResumeBLockedEmptySubpartition() throws IOException,
InterruptedException {
Review comment:
nit `BLocked` -> `Blocked`
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/PipelinedSubpartitionWithReadViewTest.java
##########
@@ -487,42 +487,61 @@ private void
testBacklogConsistentWithNumberOfConsumableBuffers(
}
@Test
- public void testBlockedByCheckpointAndResumeConsumption()
- throws IOException, InterruptedException {
+ public void testResumeBlockedSubpartitionWithEvents() throws IOException,
InterruptedException {
blockSubpartitionByCheckpoint(1);
// add an event after subpartition blocked
subpartition.add(createEventBufferConsumer(BUFFER_SIZE,
Buffer.DataType.EVENT_BUFFER));
// no data available notification after adding an event
checkNumNotificationsAndAvailability(1);
+ // Resumption will make the subpartition available.
resumeConsumptionAndCheckAvailability(0, true);
assertNextEvent(readView, BUFFER_SIZE, null, false, 0, false, true);
+ }
- blockSubpartitionByCheckpoint(2);
+ @Test
+ public void testResumeBlockedSubpartitionWithUnfinishedBuffer()
+ throws IOException, InterruptedException {
+ blockSubpartitionByCheckpoint(1);
// add a buffer and flush the subpartition
subpartition.add(createFilledFinishedBufferConsumer(BUFFER_SIZE));
subpartition.flush();
// no data available notification after adding a buffer and flushing
the subpartition
- checkNumNotificationsAndAvailability(2);
+ checkNumNotificationsAndAvailability(1);
- resumeConsumptionAndCheckAvailability(Integer.MAX_VALUE, false);
+ // Resumption will make the subpartition available.
+ resumeConsumptionAndCheckAvailability(Integer.MAX_VALUE, true);
Review comment:
Do we have a test case where we resume consumption without previous
flush and we assert that the unfinished buffers is NOT available?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]