reswqa commented on code in PR #21916:
URL: https://github.com/apache/flink/pull/21916#discussion_r1104554740


##########
flink-clients/src/test/java/org/apache/flink/client/ClientHeartbeatTest.java:
##########
@@ -58,11 +59,9 @@ void testJobCancelledIfClientHeartbeatTimeout() throws 
Exception {
         JobClient jobClient = submitJob(createConfiguration(true));
 
         // The client doesn't report heartbeat to the dispatcher.
-
-        assertThat(jobClient.getJobExecutionResult())
-                .failsWithin(Duration.ofSeconds(1))
-                .withThrowableOfType(ExecutionException.class)
-                .withMessageContaining("Job was cancelled");
+        assertThatThrownBy(() -> jobClient.getJobExecutionResult().get())

Review Comment:
   Thanks for your explanation, @XComp. I think your proposal make more sense. 
   Anyway, the main reason for this test failure is that the timeout of 1s is 
inappropriate. We can increase the timeout or reduce the interval. +1 for keep 
the 1s timeout, and then setting the `CLIENT_ ALIVENESS_ CHECK_ DURATION` to 
`ClientHeartbeatTest.clientHeartbeatInterval`. 



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