tillrohrmann commented on a change in pull request #14910:
URL: https://github.com/apache/flink/pull/14910#discussion_r576312246



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/declarative/MockExecutionGraph.java
##########
@@ -69,15 +73,22 @@ public MockExecutionGraph() throws IOException {
                 1,
                 ExecutionGraph.class.getClassLoader(),
                 VoidBlobWriter.getInstance(),
-                
PartitionReleaseStrategyFactoryLoader.loadPartitionReleaseStrategyFactory(
-                        new Configuration()),
+                getPartitionReleaseStrategyFactoryLoader(),
                 NettyShuffleMaster.INSTANCE,
                 NoOpJobMasterPartitionTracker.INSTANCE,
                 ScheduleMode.EAGER,
                 NoOpExecutionDeploymentListener.get(),
                 (execution, newState) -> {},
                 0L);
         this.setJsonPlan(""); // field must not be null for 
ArchivedExecutionGraph creation
+        this.attachJobGraph(Collections.emptyList()); // method must be called 
to initialize
+        // PartitionReleaseStrategy.
+    }
+
+    private static PartitionReleaseStrategy.Factory 
getPartitionReleaseStrategyFactoryLoader() {
+        Configuration conf = new Configuration();
+        conf.set(PARTITION_RELEASE_DURING_JOB_EXECUTION, false);
+        return 
PartitionReleaseStrategyFactoryLoader.loadPartitionReleaseStrategyFactory(conf);

Review comment:
       Hmm, I strongly suggest to add an interface for testing in the 
foreseeable future. I think we are seeing the consequences of mocking the 
`ExecutionGraph` by running into problems originating from setting it up 
wrongly.




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


Reply via email to