You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/01/13 12:24:19 UTC

[GitHub] [flink] pnowojski commented on a change in pull request #10824: [FLINK-15152][checkpointing] Restatrt CheckpointCoordinator if StopWithSavepoint failed

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:
   1. I think you should be more specific and verify for example exact `CheckpointFailureReason`.
   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:
users@infra.apache.org


With regards,
Apache Git Services