pnowojski commented on a change in pull request #10824: 
[FLINK-15152][checkpointing] Restatrt CheckpointCoordinator if 
StopWithSavepoint failed
URL: https://github.com/apache/flink/pull/10824#discussion_r365769560
 
 

 ##########
 File path: 
flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterStopWithSavepointIT.java
 ##########
 @@ -194,6 +197,30 @@ private void 
throwingExceptionOnCallbackWithRestartsHelper(final boolean termina
                assertThat(getJobStatus(), 
either(equalTo(JobStatus.CANCELLING)).or(equalTo(JobStatus.CANCELED)));
        }
 
+       @Test
+       public void testRestartCheckpointCoordinatorIfStopWithSavepointFails() 
throws Exception {
+               setUpJobGraph(ExceptionOnCallbackStreamTask.class, 
RestartStrategies.noRestart());
+
+               try {
+                       Files.setPosixFilePermissions(savepointDirectory, 
Collections.emptySet());
+               } catch (IOException e) {
+                       Assume.assumeNoException(e);
+               }
+
+               try {
+                       stopWithSavepoint(true).get();
+                       fail();
+               } catch (Exception e) {
+                       assertThat(ExceptionUtils.findThrowable(e, 
CheckpointException.class).isPresent(), equalTo(true));
 
 Review comment:
   nit:
   1. I think you should be more specific and verify for example exact 
`CheckpointFailureReason` if this is easy thing to do (otherwise there are 
higher chances for the test incorrectly passing because of different 
bug/exception).
   2. If the exception is not what you expected, you should just `throw e` it, 
instead of using `assertThat`, to get an even nicer exception message with a 
stack trace.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to