akalash commented on a change in pull request #18332:
URL: https://github.com/apache/flink/pull/18332#discussion_r785754167



##########
File path: 
flink-tests/src/test/java/org/apache/flink/test/checkpointing/SavepointITCase.java
##########
@@ -431,36 +430,48 @@ public void invoke(Long value) {
                                 .build());
         cluster.before();
         try {
-            final JobID jobID1 = new JobID();
-            jobGraph.setJobID(jobID1);
-            cluster.getClusterClient().submitJob(jobGraph).get();
-            CommonTestUtils.waitForAllTaskRunning(cluster.getMiniCluster(), 
jobID1, false);
+            final JobID firstJobId = new JobID();
+            final JobGraph firstJobGraph = InstantiationUtil.clone(jobGraph);

Review comment:
       As I understand, you don't need `clone` here anymore

##########
File path: 
flink-tests/src/test/java/org/apache/flink/test/checkpointing/SavepointITCase.java
##########
@@ -431,36 +430,48 @@ public void invoke(Long value) {
                                 .build());
         cluster.before();
         try {
-            final JobID jobID1 = new JobID();
-            jobGraph.setJobID(jobID1);
-            cluster.getClusterClient().submitJob(jobGraph).get();
-            CommonTestUtils.waitForAllTaskRunning(cluster.getMiniCluster(), 
jobID1, false);
+            final JobID firstJobId = new JobID();
+            final JobGraph firstJobGraph = InstantiationUtil.clone(jobGraph);
+            firstJobGraph.setJobID(firstJobId);
+            cluster.getClusterClient().submitJob(firstJobGraph).get();
+            CommonTestUtils.waitForAllTaskRunning(cluster.getMiniCluster(), 
firstJobId, false);
             // wait for some records to be processed before taking the 
checkpoint
             counter.get().await();
-            final String firstCheckpoint = 
cluster.getMiniCluster().triggerCheckpoint(jobID1).get();
-
-            cluster.getClusterClient().cancel(jobID1).get();
-            jobGraph.setSavepointRestoreSettings(
+            final String firstCheckpoint =
+                    
cluster.getMiniCluster().triggerCheckpoint(firstJobId).get();
+            cluster.getClusterClient().cancel(firstJobId).get();
+            CommonTestUtils.waitForJobStatus(

Review comment:
       Since you cloned the object inside of submit. Do I understand correctly, 
that we can avoid `waitForJobStatus`? (I understand that it also makes sense, 
but I just don't want to overcomplicate the code if it is not necessary)




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