Jiayi-Liao commented on a change in pull request #17151: URL: https://github.com/apache/flink/pull/17151#discussion_r705293083
########## File path: flink-tests/src/test/java/org/apache/flink/test/checkpointing/SavepointITCase.java ########## @@ -515,6 +517,50 @@ public void testTriggerSavepointWithCheckpointingDisabled() throws Exception { } } + @Test + public void testTriggerSavepointWithoutCheckpointBaseLocations() throws Exception { + StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); + env.getCheckpointConfig().disableCheckpointing(); + env.setParallelism(1); + + env.addSource(new IntegerStreamSource()).addSink(new DiscardingSink<>()); + + JobGraph jobGraph = env.getStreamGraph().getJobGraph(); + + Configuration config = getFileBasedCheckpointsConfig(); + config.addAll(jobGraph.getJobConfiguration()); + + MiniClusterWithClientResource cluster = + new MiniClusterWithClientResource( + new MiniClusterResourceConfiguration.Builder() + .setConfiguration(config) + .setNumberTaskManagers(1) + .setNumberSlotsPerTaskManager(1) + .build()); + cluster.before(); + ClusterClient<?> client = cluster.getClusterClient(); + + String savepointPath = null; + try { + client.submitJob(jobGraph).get(); + + waitForAllTaskRunning(cluster.getMiniCluster(), jobGraph.getJobID(), false); + + savepointPath = client.triggerSavepoint(jobGraph.getJobID(), null).get(); + + assertNotNull(savepointPath); + + client.cancel(jobGraph.getJobID()).get(); + // checkpoint directory should not be initialized + assertEquals(0, Objects.requireNonNull(checkpointDir.listFiles()).length); Review comment: The children files of `checkpointDir` should be empty if the checkpoint based location is not initialized. Of course we can use `exists` with `checkpointDir/{jobID}` to achieve the same goal. -- 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-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org