zentol commented on a change in pull request #16132:
URL: https://github.com/apache/flink/pull/16132#discussion_r649222131



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/FileExecutionGraphInfoStoreTest.java
##########
@@ -341,11 +350,45 @@ public void testMaximumCapacity() throws IOException {
     /** Tests that a session cluster can terminate gracefully when jobs are 
still running. */
     @Test
     public void testPutSuspendedJobOnClusterShutdown() throws Exception {
+        final Duration timeout = Duration.ofSeconds(5);
         try (final MiniCluster miniCluster =
                 new PersistingMiniCluster(new 
MiniClusterConfiguration.Builder().build())) {
             miniCluster.start();
-            final JobGraph jobGraph = JobGraphTestUtils.singleNoOpJobGraph();
+            final JobVertex vertex = new JobVertex("blockingVertex");
+            vertex.setInvokableClass(BlockingNoOpInvokable.class);
+            final JobGraph jobGraph = 
JobGraphTestUtils.streamingJobGraph(vertex);
+            final JobID jobId = jobGraph.getJobID();
             miniCluster.submitJob(jobGraph);
+            CommonTestUtils.waitUntilCondition(
+                    () -> {
+                        try {
+                            // Wait until the job is marked as RUNNING
+                            if (miniCluster.getJobStatus(jobId).get() != 
JobStatus.RUNNING) {

Review comment:
       there are easier ways to go about this, like 
`JobMasterTriggerSavepointITCase.NoOpBlockingInvokable`.




-- 
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:
[email protected]


Reply via email to