LadyForest commented on code in PR #21802:
URL: https://github.com/apache/flink/pull/21802#discussion_r1094004423
##########
flink-table/flink-sql-client/src/test/java/org/apache/flink/table/client/gateway/local/ExecutorImplITCase.java:
##########
@@ -481,17 +489,35 @@ void testStopJob() throws Exception {
// wait till the job turns into running status or the test times
out
TestUtils.waitUntilAllTasksAreRunning(clusterClient, jobID);
- StringData savepointPath =
- CollectionUtil.iteratorToList(
- executor.executeStatement(
- String.format("STOP JOB '%s' WITH
SAVEPOINT", jobID)))
- .get(0)
- .getString(0);
- assertThat(savepointPath)
- .isNotNull()
- .matches(
- stringData ->
-
Files.exists(Paths.get(URI.create(stringData.toString()))));
+ String stopJobCmd =
+ String.format("STOP JOB '%s'%s", jobID, withSavepoint ? "
WITH SAVEPOINT" : "");
+ ClientResult stopResult = executor.executeStatement(stopJobCmd);
+ JobStatus expectedJobStatus;
+ if (withSavepoint) {
+ String savepointPath =
+
CollectionUtil.iteratorToList(stopResult).get(0).getString(0).toString();
+
+ assertThat(savepointPath)
+ .matches(path ->
Files.exists(Paths.get(URI.create(path))));
+ expectedJobStatus = JobStatus.FINISHED;
+ } else {
+ TestUtils.waitUntilJobCanceled(jobID, clusterClient);
Review Comment:
Good point, this can be removed after the fix
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]