JesseAtSZ commented on PR #20091:
URL: https://github.com/apache/flink/pull/20091#issuecomment-1200444798

   How can I construct `FINALIZE_CHECKPOINT_FAILURE`? I tried to implement a 
`CheckpointStorage`, but I found that there are too many methods to implement.
   
   `    @Test(timeout = 20_000)
       public void testFinalizeCheckpointFailureTriggerJobFailed() throws 
Exception {
           final StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment();
           env.enableCheckpointing(500);
           env.setRestartStrategy(RestartStrategies.noRestart());
           CheckpointConfig checkpointConfig = env.getCheckpointConfig();
           checkpointConfig.setCheckpointStorage(new MockCheckpointStorage());
           env.addSource(new StringGeneratingSourceFunction()).addSink(new 
DiscardingSink<>());
           JobGraph jobGraph = 
StreamingJobGraphGenerator.createJobGraph(env.getStreamGraph());
           try {
               // assert that the job only execute checkpoint once and only 
failed once.
               TestUtils.submitJobAndWaitForResult(
                       cluster.getClusterClient(), jobGraph, 
getClass().getClassLoader());
           }
           ......
   }`


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

Reply via email to