zentol commented on code in PR #19968: URL: https://github.com/apache/flink/pull/19968#discussion_r901375211
########## flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/StopWithSavepointTest.java: ########## @@ -337,6 +343,70 @@ void testRestartOnTaskFailureAfterSavepointCompletion() throws Exception { } } + @Test + void testOnFailureWaitsForSavepointCompletion() throws Exception { + try (MockStopWithSavepointContext ctx = new MockStopWithSavepointContext()) { + CheckpointScheduling mockStopWithSavepointOperations = new MockCheckpointScheduling(); + CompletableFuture<String> savepointFuture = new CompletableFuture<>(); + StateTrackingMockExecutionGraph executionGraph = new StateTrackingMockExecutionGraph(); + StopWithSavepoint sws = + createStopWithSavepoint( + ctx, mockStopWithSavepointOperations, executionGraph, savepointFuture); + ctx.setStopWithSavepoint(sws); + + ctx.setHowToHandleFailure(failure -> FailureResult.canRestart(failure, Duration.ZERO)); + + sws.onFailure(new Exception("task failure")); + ctx.triggerExecutors(); Review Comment: yes I'll add a comment -- 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