zhijiangW commented on a change in pull request #6809: [FLINK-10491][network] Pass BufferPoolOwner in the constructor of LocalBufferPool URL: https://github.com/apache/flink/pull/6809#discussion_r226552102
########## File path: flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/ResultPartitionTest.java ########## @@ -205,6 +216,66 @@ protected void testAddOnPartition(final ResultPartitionType pipelined) } } + @Test + public void testReleaseMemoryOnBlockingPartition() throws Exception { + testReleaseMemory(ResultPartitionType.BLOCKING); + } + + @Test + public void testReleaseMemoryOnPipelinedPartition() throws Exception { + testReleaseMemory(ResultPartitionType.PIPELINED); + } + + /** + * Tests {@link ResultPartition#releaseMemory(int)} on a working partition. + * + * @param resultPartitionType the result partition type to set up + */ + private void testReleaseMemory(final ResultPartitionType resultPartitionType) throws Exception { + final int numBuffers = 10; + final NetworkEnvironment network = new NetworkEnvironment( Review comment: Another option is we provide another simple constructor for `NetworkEnvironment` instead of `Builder`, which one do you prefer? I reviewed all the current usages and the above deduplication can cover the existing usages in tests except for `StreamNetworkBenchmarkEnvironment` which provides additional `ConnectionManager`. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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