tillrohrmann commented on a change in pull request #14662:
URL: https://github.com/apache/flink/pull/14662#discussion_r586187938



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterTest.java
##########
@@ -353,13 +359,17 @@ public void declineCheckpoint(DeclineCheckpoint 
declineCheckpoint) {
             RpcCheckpointResponder rpcCheckpointResponder =
                     new RpcCheckpointResponder(jobMasterGateway);
             rpcCheckpointResponder.declineCheckpoint(
-                    jobGraph.getJobID(), new ExecutionAttemptID(), 1, 
userException);
+                    jobGraph.getJobID(), new ExecutionAttemptID(), 1, 
checkpointException);
 
             Throwable throwable =
                     declineCheckpointMessageFuture.get(
                             testingTimeout.toMilliseconds(), 
TimeUnit.MILLISECONDS);
-            assertThat(throwable, instanceOf(SerializedThrowable.class));
-            assertThat(throwable.getMessage(), 
equalTo(userException.getMessage()));
+            assertThat(throwable, instanceOf(CheckpointException.class));
+            Optional<Throwable> throwableWithMessage =
+                    ExceptionUtils.findThrowableWithMessage(throwable, 
userException.getMessage());
+            assertTrue(throwableWithMessage.isPresent());
+            assertThat(
+                    throwableWithMessage.get().getMessage(), 
equalTo(userException.getMessage()));

Review comment:
       But why do we start a `JobMaster` in order to test this kind of 
behaviour. What we are effectively testing here is that the passed 
`CheckpointException` still contains the cause as it was constructed with. The 
test seems to be prohibitively expensive for such a trivial behavioral test.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to