link3280 commented on code in PR #20159:
URL: https://github.com/apache/flink/pull/20159#discussion_r924230945
##########
flink-table/flink-sql-client/src/test/java/org/apache/flink/table/client/gateway/local/LocalExecutorITCase.java:
##########
@@ -406,6 +420,38 @@ public void testBatchQueryExecutionMultipleTimes() throws
Exception {
}
}
+ @Test(timeout = 90_000L)
+ public void testStopJob() throws Exception {
+ final Map<String, String> configMap = new HashMap<>();
+ configMap.put(EXECUTION_RESULT_MODE.key(), ResultMode.TABLE.name());
+ configMap.put(RUNTIME_MODE.key(),
RuntimeExecutionMode.STREAMING.name());
+ configMap.put(TableConfigOptions.TABLE_DML_SYNC.key(), "false");
+
+ final LocalExecutor executor =
+ createLocalExecutor(
+ Collections.singletonList(udfDependency),
Configuration.fromMap(configMap));
+ String sessionId = executor.openSession("test-session");
+
+ final String srcDdl = "CREATE TABLE src (a STRING) WITH ('connector' =
'datagen')";
+ final String snkDdl = "CREATE TABLE snk (a STRING) WITH ('connector' =
'blackhole')";
+ final String insert = "INSERT INTO snk SELECT a FROM src;";
+
+ try {
+ executor.executeOperation(sessionId,
executor.parseStatement(sessionId, srcDdl));
+ executor.executeOperation(sessionId,
executor.parseStatement(sessionId, snkDdl));
+ TableResult result =
+ executor.executeOperation(
+ sessionId, executor.parseStatement(sessionId,
insert));
+ JobID jobId = result.getJobClient().get().getJobID();
+ // wait till the job turns into running status
+ Thread.sleep(2_000L);
Review Comment:
Good point.
--
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]