zhijiangW commented on a change in pull request #9132: [FLINK-13245][network] 
Fix the bug of file resource leak while canceling partition request
URL: https://github.com/apache/flink/pull/9132#discussion_r307782071
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/PartitionTestUtils.java
 ##########
 @@ -158,4 +159,11 @@ public ResultPartitionID getResultPartitionID() {
                        true,
                        releaseType);
        }
+
+       public static void writeBuffers(ResultPartition partition, int 
numberOfBuffers, int bufferSize) throws IOException {
+               for (int i = 0; i < numberOfBuffers; i++) {
+                       
partition.addBufferConsumer(createFilledBufferConsumer(bufferSize, bufferSize), 
0);
+               }
+               partition.finish();
+       }
 
 Review comment:
   In addition, these three tests are focusing on different classes actually, 
which are `ResultPartition`, `ResultSubpartition` and `BoundedData`, so they 
are not totally duplications. If we want to unify them, we have to also 
refactor the relevant unit tests. I do not think it is necessary to do so now.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to