This is an automated email from the ASF dual-hosted git repository.
xtsong pushed a commit to branch release-1.13
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.13 by this push:
new 51c02e4 [FLINK-23196][tests] use MiniClusterResource
51c02e4 is described below
commit 51c02e434629722ed622c72b9132f973ce51d3a8
Author: Chesnay Schepler <[email protected]>
AuthorDate: Thu Jul 1 09:44:24 2021 +0200
[FLINK-23196][tests] use MiniClusterResource
---
.../flink/runtime/jobmaster/JobMasterITCase.java | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git
a/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterITCase.java
b/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterITCase.java
index d377fbc..f6e23c1 100644
---
a/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterITCase.java
+++
b/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterITCase.java
@@ -29,8 +29,8 @@ import
org.apache.flink.api.connector.source.SplitEnumeratorContext;
import org.apache.flink.core.io.SimpleVersionedSerializer;
import org.apache.flink.runtime.jobgraph.JobGraph;
import org.apache.flink.runtime.jobgraph.JobGraphTestUtils;
-import org.apache.flink.runtime.minicluster.MiniCluster;
-import org.apache.flink.runtime.minicluster.MiniClusterConfiguration;
+import org.apache.flink.runtime.testutils.MiniClusterResource;
+import org.apache.flink.runtime.testutils.MiniClusterResourceConfiguration;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.sink.DiscardingSink;
@@ -47,22 +47,23 @@ public class JobMasterITCase extends TestLogger {
@Test
public void testRejectionOfEmptyJobGraphs() throws Exception {
- MiniCluster miniCluster =
- new MiniCluster(
- new MiniClusterConfiguration.Builder()
- .setNumTaskManagers(1)
- .setNumSlotsPerTaskManager(1)
+ MiniClusterResource miniCluster =
+ new MiniClusterResource(
+ new MiniClusterResourceConfiguration.Builder()
+ .setNumberTaskManagers(1)
+ .setNumberSlotsPerTaskManager(1)
.build());
- miniCluster.start();
+ miniCluster.before();
JobGraph jobGraph = JobGraphTestUtils.emptyJobGraph();
try {
- miniCluster.submitJob(jobGraph).get();
+ miniCluster.getMiniCluster().submitJob(jobGraph).get();
fail("Expect failure");
} catch (Throwable t) {
assertThat(t, containsMessage("The given job is empty"));
+ } finally {
+ miniCluster.after();
}
- miniCluster.close();
}
/**