dawidwys commented on a change in pull request #17151:
URL: https://github.com/apache/flink/pull/17151#discussion_r705210537
##########
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:
Why do you use `listFiles` instead of `exists` here?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]