fredia commented on code in PR #22234:
URL: https://github.com/apache/flink/pull/22234#discussion_r1144191958


##########
flink-tests/src/test/java/org/apache/flink/test/state/ChangelogRescalingITCase.java:
##########
@@ -329,24 +329,30 @@ public boolean request() {
     private String checkpointAndCancel(JobID jobID) throws Exception {
         waitForCheckpoint(jobID, cluster.getMiniCluster(), 1);
         cluster.getClusterClient().cancel(jobID).get();
-        checkStatus(jobID);
+        waitForSuccessfulTermination(jobID);
         return CommonTestUtils.getLatestCompletedCheckpointPath(jobID, 
cluster.getMiniCluster())
                 .<NoSuchElementException>orElseThrow(
                         () -> {
                             throw new NoSuchElementException("No checkpoint 
was created yet");
                         });
     }
 
-    private void checkStatus(JobID jobID) throws InterruptedException, 
ExecutionException {
-        if 
(cluster.getClusterClient().getJobStatus(jobID).get().isGloballyTerminalState())
 {
-            cluster.getClusterClient()
-                    .requestJobResult(jobID)
-                    .get()
-                    .getSerializedThrowable()
-                    .ifPresent(
-                            serializedThrowable -> {
-                                throw new 
RuntimeException(serializedThrowable);
-                            });
+    private void waitForSuccessfulTermination(JobID jobID)
+            throws InterruptedException, ExecutionException {
+        while (true) {

Review Comment:
   Maybe we can use `CommonTestUtils.waitUntilCondition` instead of `while 
loop`.



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