gaoyunhaii commented on a change in pull request #8687:
[FLINK-12612][coordination] Track stored partition on the TaskExecutor
URL: https://github.com/apache/flink/pull/8687#discussion_r293305758
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/ResultPartitionManagerTest.java
##########
@@ -60,4 +61,26 @@ public void testCreateViewForRegisteredPartition() throws
Exception {
partitionManager.registerResultPartition(partition);
partitionManager.createSubpartitionView(partition.getPartitionId(), 0, new
NoOpBufferAvailablityListener());
}
+
+ @Test
+ public void testExternallyManagedPartitionReleaseIfFlagDisabled() {
Review comment:
Just `testExternallyManagedPartitionReleaseIfFlagDisabled` and
`testExternallyManagedPartitionReleaseIfFlagEnabled`, these two methods seem to
have most logic in common, so I think we may have a method like
`
public void testExternallyManagedPartitionRelease(boolean
releaseExternalManagedPartitions) {
final ResultPartitionManager partitionManager = new
ResultPartitionManager(releaseExternalManagedPartitions);
final ResultPartition partition = new
ResultPartitionBuilder().setIsExternallyManaged(true).build();
partitionManager.registerResultPartition(partition);
partitionManager.onConsumedPartition(partition);
assertThat(partition.isReleased(),
is(releaseExternalManagedPartitions));
}
`
and let the two tests call this method with different parameters.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services