flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tillrohrmann <...@git.apache.org>
Subject [GitHub] flink pull request #5730: [FLINK-8961][tests] Port JobRetrievalITCase to fli...
Date Fri, 23 Mar 2018 09:58:12 GMT
Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5730#discussion_r176683463
  
    --- 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 could also use a `@ClassRule` where we set the `MiniClusterType` to `FLIP6`.


---

Mime
View raw message