XComp commented on a change in pull request #19191:
URL: https://github.com/apache/flink/pull/19191#discussion_r831215567
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/ZooKeeperCheckpointIDCounterITCase.java
##########
@@ -66,6 +70,56 @@ public void testShutdownRemovesState() throws Exception {
assertThat(client.checkExists().forPath(counter.getPath())).isNull();
}
+ @Test
+ public void testShutdownForLocallyTerminatedJobStatus() throws Exception {
+ ZooKeeperCheckpointIDCounter counter = createCheckpointIdCounter();
+ counter.start();
+
+ CuratorFramework client = zookeeper.getClient();
+
assertThat(client.checkExists().forPath(counter.getPath())).isNotNull();
+
+ counter.shutdown(JobStatus.SUSPENDED).join();
+
assertThat(client.checkExists().forPath(counter.getPath())).isNotNull();
+ }
+
+ @Test
+ public void testIdempotentShutdown() throws Exception {
+ ZooKeeperCheckpointIDCounter counter = createCheckpointIdCounter();
+ counter.start();
+
+ CuratorFramework client = zookeeper.getClient();
+ client.delete().forPath(counter.getPath());
+
+ // shutdown shouldn't fail due to missing path
+ counter.shutdown(JobStatus.FINISHED).join();
+ assertThat(client.checkExists().forPath(counter.getPath())).isNull();
+ }
+
+ @Test
+ public void testShutdownWithFailureDueToMissingConnection() throws
Exception {
+ ZooKeeperCheckpointIDCounter counter = createCheckpointIdCounter();
+ counter.start();
+
+ cleanAndStopZooKeeperIfRunning();
+
+
assertThat(counter.shutdown(JobStatus.FINISHED)).failsWithin(Duration.ofHours(1));
+ }
+
+ @Test
+ public void testShutdownWithFailureDueToChildNodes() throws Exception {
Review comment:
True, and valid point about the comment: That was copied over by mistake
--
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]