You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/11/04 17:55:41 UTC

[GitHub] [flink] reswqa commented on a diff in pull request #21209: [FLINK-29818] Fix the unstable test HsResultPartitionTest.testAvailability

reswqa commented on code in PR #21209:
URL: https://github.com/apache/flink/pull/21209#discussion_r1014315054


##########
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/hybrid/HsFullSpillingStrategyTest.java:
##########
@@ -149,9 +147,9 @@ void testDecideActionWithGlobalInfo() {
 
         Map<Integer, List<BufferIndexAndChannel>> expectedReleaseBuffers = new HashMap<>();
         expectedReleaseBuffers.put(
-                subpartition1, new ArrayList<>(subpartitionBuffers1.subList(0, 2)));
+                subpartition1, new ArrayList<>(subpartitionBuffers1.subList(0, 3)));
         expectedReleaseBuffers.put(
-                subpartition2, new ArrayList<>(subpartitionBuffers2.subList(1, 3)));
+                subpartition2, new ArrayList<>(subpartitionBuffers2.subList(1, 4)));

Review Comment:
   > And please check createBufferIndexAndChannelsList. It's creating memory segment and network buffer for nothing.
   good catch, a previous refactoring changed `BufferWithIdentity` into `BufferIndexAndChannel`, so there is no need to create a real buffer. Unfortunately, I forgot to remove the useless code here.



##########
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/hybrid/HsFullSpillingStrategyTest.java:
##########
@@ -149,9 +147,9 @@ void testDecideActionWithGlobalInfo() {
 
         Map<Integer, List<BufferIndexAndChannel>> expectedReleaseBuffers = new HashMap<>();
         expectedReleaseBuffers.put(
-                subpartition1, new ArrayList<>(subpartitionBuffers1.subList(0, 2)));
+                subpartition1, new ArrayList<>(subpartitionBuffers1.subList(0, 3)));
         expectedReleaseBuffers.put(
-                subpartition2, new ArrayList<>(subpartitionBuffers2.subList(1, 3)));
+                subpartition2, new ArrayList<>(subpartitionBuffers2.subList(1, 4)));

Review Comment:
   > And please check createBufferIndexAndChannelsList. It's creating memory segment and network buffer for nothing.
   
   good catch, a previous refactoring changed `BufferWithIdentity` into `BufferIndexAndChannel`, so there is no need to create a real buffer. Unfortunately, I forgot to remove the useless code here.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org