fsk119 commented on code in PR #21717:
URL: https://github.com/apache/flink/pull/21717#discussion_r1089677325


##########
flink-table/flink-sql-client/src/test/java/org/apache/flink/table/client/gateway/local/ExecutorImplITCase.java:
##########
@@ -414,50 +462,130 @@ void testStopJob() throws Exception {
         final String insert = "INSERT INTO snk SELECT a FROM src;";
 
         try {
-            executor.executeOperation(executor.parseStatement(srcDdl));
-            executor.executeOperation(executor.parseStatement(snkDdl));
-            TableResult result = 
executor.executeOperation(executor.parseStatement(insert));
-            JobClient jobClient = result.getJobClient().get();
-            JobID jobId = jobClient.getJobID();
+            executor.configureSession(srcDdl);
+            executor.configureSession(snkDdl);
+            ClientResult result = executor.executeStatement(insert);
+            JobID jobID = result.getJobId();
 
             // wait till the job turns into running status or the test times 
out
-            JobStatus jobStatus;
-            do {
-                Thread.sleep(2_000L);
-                jobStatus = jobClient.getJobStatus().get();
-            } while (jobStatus != JobStatus.RUNNING);
-
-            Optional<String> savepoint = executor.stopJob(jobId.toString(), 
true, true);
-            assertThat(savepoint).isPresent();
+            TestUtils.waitUntilAllTasksAreRunning(clusterClient, jobID);
+            StringData savepointPath =
+                    CollectionUtil.iteratorToList(
+                                    executor.executeStatement(
+                                            String.format("STOP JOB '%s' WITH 
SAVEPOINT", jobID)))
+                            .get(0)
+                            .getString(0);
+            assertThat(
+                            Files.exists(
+                                    Paths.get(
+                                            URI.create(
+                                                    
Preconditions.checkNotNull(savepointPath)
+                                                            .toString()))))
+                    .isTrue();

Review Comment:
   Thanks for pointing it out. I think the root cause is related the 
implementation of the sql gateway and we can discuss in  another thread. I have 
opened a ticket to track this: FLINK-30811



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