You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by zentol <gi...@git.apache.org> on 2018/04/03 10:25:10 UTC
[GitHub] flink pull request #5730: [FLINK-8961][tests] Port JobRetrievalITCase to fli...
Github user zentol commented on a diff in the pull request:
https://github.com/apache/flink/pull/5730#discussion_r178777980
--- Diff: flink-tests/src/test/java/org/apache/flink/test/example/client/JobRetrievalITCase.java ---
@@ -21,54 +21,69 @@
import org.apache.flink.api.common.JobID;
import org.apache.flink.client.deployment.StandaloneClusterId;
-import org.apache.flink.client.program.ClusterClient;
-import org.apache.flink.client.program.StandaloneClusterClient;
+import org.apache.flink.client.program.rest.RestClusterClient;
import org.apache.flink.configuration.Configuration;
-import org.apache.flink.runtime.client.JobRetrievalException;
+import org.apache.flink.configuration.JobManagerOptions;
+import org.apache.flink.configuration.RestOptions;
import org.apache.flink.runtime.execution.Environment;
import org.apache.flink.runtime.jobgraph.JobGraph;
import org.apache.flink.runtime.jobgraph.JobVertex;
import org.apache.flink.runtime.jobgraph.tasks.AbstractInvokable;
-import org.apache.flink.runtime.minicluster.FlinkMiniCluster;
-import org.apache.flink.runtime.testingUtils.TestingCluster;
-import org.apache.flink.runtime.testingUtils.TestingJobManagerMessages;
+import org.apache.flink.runtime.minicluster.MiniCluster;
+import org.apache.flink.runtime.minicluster.MiniClusterConfiguration;
+import org.apache.flink.testutils.category.Flip6;
+import org.apache.flink.util.ExceptionUtils;
import org.apache.flink.util.TestLogger;
-import akka.actor.ActorRef;
-import akka.actor.ActorSystem;
-import akka.testkit.JavaTestKit;
import org.junit.AfterClass;
-import org.junit.BeforeClass;
import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import java.util.Optional;
import java.util.concurrent.Semaphore;
import java.util.concurrent.atomic.AtomicReference;
-import scala.collection.Seq;
-
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
/**
* Tests retrieval of a job from a running Flink cluster.
*/
+@Category(Flip6.class)
public class JobRetrievalITCase extends TestLogger {
private static final Semaphore lock = new Semaphore(1);
- private static FlinkMiniCluster cluster;
+ private static final MiniCluster CLUSTER;
+ private static final RestClusterClient<StandaloneClusterId> CLIENT;
- @BeforeClass
- public static void before() {
- Configuration configuration = new Configuration();
- cluster = new TestingCluster(configuration, false);
- cluster.start();
+ static {
+ try {
+ MiniClusterConfiguration clusterConfiguration = new MiniClusterConfiguration.Builder()
+ .setNumTaskManagers(1)
+ .setNumSlotsPerTaskManager(4)
+ .build();
+ CLUSTER = new MiniCluster(clusterConfiguration);
+ CLUSTER.start();
--- End diff --
We can only do that if we don't want to rely on `MiniCluster#getRestAddress` for creating the client config.
---