xintongsong commented on code in PR #20796:
URL: https://github.com/apache/flink/pull/20796#discussion_r969162160


##########
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/hybrid/HsFileDataIndexImplTest.java:
##########
@@ -54,23 +54,32 @@ void before() {
     @Test
     void testGetReadableRegionBufferNotExist() {
         hsDataIndex.addBuffers(createSpilledBuffers(0, Arrays.asList(0, 2)));
-        hsDataIndex.markBufferReadable(0, 0);
-        hsDataIndex.markBufferReadable(0, 2);
+        hsDataIndex.markBufferReleased(0, 0);
+        hsDataIndex.markBufferReleased(0, 2);
 
         // subpartition 0 does not have buffer with index 1
-        assertThat(hsDataIndex.getReadableRegion(0, 1)).isNotPresent();
+        assertThat(hsDataIndex.getReadableRegion(0, 1, -1)).isNotPresent();
 
         // subpartition 1 has no buffer
-        assertThat(hsDataIndex.getReadableRegion(1, 0)).isNotPresent();
+        assertThat(hsDataIndex.getReadableRegion(1, 0, -1)).isNotPresent();
     }
 
     /** If target buffer is not readable, {@link Optional#empty()} should be 
eventually returned. */
     @Test
     void testGetReadableRegionNotReadable() {
         hsDataIndex.addBuffers(createSpilledBuffers(0, 
Collections.singletonList(0)));
 
-        // 0-0 is not readable
-        assertThat(hsDataIndex.getReadableRegion(0, 0)).isNotPresent();
+        // 0-0 is not readable as consuming offset is bigger than 0.
+        assertThat(hsDataIndex.getReadableRegion(0, 0, 1)).isNotPresent();

Review Comment:
   Should mark 0-0 released.



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

Reply via email to