Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5720#discussion_r176482195
  
    --- Diff: 
flink-metrics/flink-metrics-jmx/src/test/java/org/apache/flink/runtime/jobmanager/JMXJobManagerMetricTest.java
 ---
    @@ -92,28 +101,26 @@ public void testJobManagerJMXMetricAccess() throws 
Exception {
                                        true),
                                null));
     
    -                   flink.waitForActorsToBeAlive();
    -
    -                   flink.submitJobDetached(jobGraph);
    +                   ClusterClient<?> client = 
MINI_CLUSTER_RESOURCE.getClusterClient();
    +                   client.setDetached(true);
    +                   client.submitJob(jobGraph, 
JMXJobManagerMetricTest.class.getClassLoader());
     
    -                   Future<Object> jobRunning = 
flink.getLeaderGateway(deadline.timeLeft())
    -                           .ask(new 
TestingJobManagerMessages.WaitForAllVerticesToBeRunning(jobGraph.getJobID()), 
deadline.timeLeft());
    -                   Await.ready(jobRunning, deadline.timeLeft());
    +                   FutureUtils.retrySuccesfulWithDelay(
    +                           () -> client.getJobStatus(jobGraph.getJobID()),
    +                           Time.milliseconds(10),
    +                           deadline,
    +                           status -> status == JobStatus.RUNNING,
    --- End diff --
    
    The check whether the job is running does not necessarily mean that all 
vertices are running. But I guess what we are waiting for is the initialization 
of the `CheckpointStatsTracker`.


---

Reply via email to