This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch release-1.11
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.11 by this push:
new bf5e7d6 [FLINK-18247][table-planner-blink] Fix unstable test:
TableITCase.testCollectWithClose
bf5e7d6 is described below
commit bf5e7d6ac5256dec01a772ebccbbcfa8c971ae81
Author: godfrey he <[email protected]>
AuthorDate: Fri Jun 12 09:56:38 2020 +0800
[FLINK-18247][table-planner-blink] Fix unstable test:
TableITCase.testCollectWithClose
This closes #12608
---
.../scala/org/apache/flink/table/api/TableITCase.scala | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git
a/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/api/TableITCase.scala
b/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/api/TableITCase.scala
index 2223b99..d14f740 100644
---
a/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/api/TableITCase.scala
+++
b/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/api/TableITCase.scala
@@ -20,8 +20,8 @@ package org.apache.flink.table.api
import org.apache.flink.api.common.JobStatus
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-import org.apache.flink.table.api.internal.TableEnvironmentImpl
import org.apache.flink.table.api.bridge.java.StreamTableEnvironment
+import org.apache.flink.table.api.internal.TableEnvironmentImpl
import org.apache.flink.table.planner.utils.TestTableSourceSinks
import org.apache.flink.types.Row
import org.apache.flink.util.TestLogger
@@ -29,7 +29,7 @@ import org.apache.flink.util.TestLogger
import org.apache.flink.shaded.guava18.com.google.common.collect.Lists
import org.hamcrest.Matchers.containsString
-import org.junit.Assert.{assertEquals, assertTrue}
+import org.junit.Assert.{assertEquals, assertNotEquals, assertTrue}
import org.junit.rules.{ExpectedException, TemporaryFolder}
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
@@ -119,7 +119,16 @@ class TableITCase(tableEnvName: String, isStreaming:
Boolean) extends TestLogger
assertEquals(ResultKind.SUCCESS_WITH_CONTENT, tableResult.getResultKind)
val it = tableResult.collect()
it.close()
- assertEquals(JobStatus.CANCELED,
tableResult.getJobClient.get().getJobStatus().get())
+ val jobStatus = try {
+ Some(tableResult.getJobClient.get().getJobStatus.get())
+ } catch {
+ // ignore the exception,
+ // because the MiniCluster maybe already been shut down when getting job
status
+ case _: Throwable => None
+ }
+ if (jobStatus.isDefined) {
+ assertNotEquals(JobStatus.RUNNING, jobStatus.get)
+ }
}
@Test