Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-18247][table-planner-blink] Fix unstable test: TableITCase.testCollectWithClose #12595

Merged
merged 3 commits into from
Jun 11, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[FLINK-18247][table-planner-blink] Fix unstable test: TableITCase.tes…
…tCollectWithClose
  • Loading branch information
godfreyhe committed Jun 11, 2020
commit 9e434548ba3706388dbd2a4b5d9cce32f5012eaa
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import org.apache.flink.util.TestLogger

import org.apache.flink.shaded.guava18.com.google.common.collect.Lists

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
Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also catch exception of assertNotEquals and makes assertNotEquals useless.

}
if (jobStatus.isDefined) {
assertNotEquals(JobStatus.RUNNING, jobStatus.get)
}
}

@Test
Expand Down