rkhachatryan commented on a change in pull request #15858:
URL: https://github.com/apache/flink/pull/15858#discussion_r629647704



##########
File path: 
flink-libraries/flink-state-processing-api/src/test/java/org/apache/flink/state/api/utils/SavepointTestBase.java
##########
@@ -56,16 +64,33 @@
         try {
             JobID jobID = client.submitJob(jobGraph).get();
 
-            return CompletableFuture.runAsync(waitingFunction::await)
-                    .thenCompose(ignore -> triggerSavepoint(client, jobID))
-                    .get(5, TimeUnit.MINUTES);
+            waitForAllRunningOrSomeTerminal(jobID);
+
+            return triggerSavepoint(client, jobID).get(5, TimeUnit.MINUTES);
         } catch (Exception e) {
             throw new RuntimeException("Failed to take savepoint", e);
         } finally {
             client.cancel(jobId);
         }
     }
 
+    private void waitForAllRunningOrSomeTerminal(JobID jobID) throws Exception 
{
+        while (true) {

Review comment:
       I think it's better to rely on CI timeout (this topic was recently 
discussed 
[here](http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/DISCUSS-Using-timeouts-in-JUnit-tests-tp50449p50601.html)).




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