You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ga...@apache.org on 2019/01/18 12:52:28 UTC
[flink] 02/02: [FLINK-10665][tests] Remove legacy test
YARNSessionFIFOITCase#testJavaAPI
This is an automated email from the ASF dual-hosted git repository.
gary pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 3cf593cb5400fcaece1f458c703d5093c202d807
Author: tison <wa...@gmail.com>
AuthorDate: Fri Jan 18 01:37:10 2019 +0800
[FLINK-10665][tests] Remove legacy test YARNSessionFIFOITCase#testJavaAPI
This closes #6917.
---
.../apache/flink/yarn/YARNSessionFIFOITCase.java | 75 +---------------------
.../flink/yarn/YARNSessionFIFOSecuredITCase.java | 3 -
2 files changed, 1 insertion(+), 77 deletions(-)
diff --git a/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNSessionFIFOITCase.java b/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNSessionFIFOITCase.java
index f6e097f..c8a90d7 100644
--- a/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNSessionFIFOITCase.java
+++ b/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNSessionFIFOITCase.java
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -18,21 +18,15 @@
package org.apache.flink.yarn;
-import org.apache.flink.client.deployment.ClusterSpecification;
-import org.apache.flink.client.program.ClusterClient;
-import org.apache.flink.configuration.ConfigConstants;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.configuration.GlobalConfiguration;
import org.apache.flink.configuration.SecurityOptions;
-import org.apache.flink.runtime.clusterframework.messages.GetClusterStatusResponse;
import org.apache.flink.test.testdata.WordCountData;
import org.apache.flink.test.util.SecureTestEnvironment;
import org.apache.flink.yarn.cli.FlinkYarnSessionCli;
import org.apache.flink.yarn.configuration.YarnConfigOptions;
-import org.apache.flink.yarn.util.YarnTestUtils;
import org.apache.commons.io.FileUtils;
-import org.apache.hadoop.fs.Path;
import org.apache.hadoop.yarn.api.records.ApplicationId;
import org.apache.hadoop.yarn.api.records.ApplicationReport;
import org.apache.hadoop.yarn.api.records.YarnApplicationState;
@@ -52,7 +46,6 @@ import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -271,70 +264,4 @@ public class YARNSessionFIFOITCase extends YarnTestBase {
checkForLogString("There is not enough memory available in the YARN cluster. The TaskManager(s) require 3840MB each. NodeManagers available: [4096, 4096]\n" +
"After allocating the JobManager (512MB) and (1/2) TaskManagers, the following NodeManagers are available: [3584, 256]");
}
-
- /**
- * Test the YARN Java API.
- */
- @Test
- public void testJavaAPI() throws Exception {
- final int waitTime = 15;
- LOG.info("Starting testJavaAPI()");
-
- String confDirPath = System.getenv(ConfigConstants.ENV_FLINK_CONF_DIR);
- Configuration configuration = GlobalConfiguration.loadConfiguration();
-
- try (final AbstractYarnClusterDescriptor clusterDescriptor = new LegacyYarnClusterDescriptor(
- configuration,
- getYarnConfiguration(),
- confDirPath,
- getYarnClient(),
- true)) {
- Assert.assertNotNull("unable to get yarn client", clusterDescriptor);
- clusterDescriptor.setLocalJarPath(new Path(flinkUberjar.getAbsolutePath()));
- clusterDescriptor.addShipFiles(Arrays.asList(flinkLibFolder.listFiles()));
-
- final ClusterSpecification clusterSpecification = new ClusterSpecification.ClusterSpecificationBuilder()
- .setMasterMemoryMB(768)
- .setTaskManagerMemoryMB(1024)
- .setNumberTaskManagers(1)
- .setSlotsPerTaskManager(1)
- .createClusterSpecification();
- // deploy
- ClusterClient<ApplicationId> yarnClusterClient = null;
- try {
- yarnClusterClient = clusterDescriptor.deploySessionCluster(clusterSpecification);
-
- GetClusterStatusResponse expectedStatus = new GetClusterStatusResponse(1, 1);
- for (int second = 0; second < waitTime * 2; second++) { // run "forever"
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- LOG.warn("Interrupted", e);
- }
- GetClusterStatusResponse status = yarnClusterClient.getClusterStatus();
- if (status != null && status.equals(expectedStatus)) {
- LOG.info("ClusterClient reached status " + status);
- break; // all good, cluster started
- }
- if (second > waitTime) {
- // we waited for 15 seconds. cluster didn't come up correctly
- Assert.fail("The custer didn't start after " + waitTime + " seconds");
- }
- }
-
- // use the cluster
- Assert.assertNotNull(yarnClusterClient.getClusterConnectionInfo());
- Assert.assertNotNull(yarnClusterClient.getWebInterfaceURL());
- LOG.info("All tests passed.");
- } finally {
- if (yarnClusterClient != null) {
- // shutdown cluster
- LOG.info("Shutting down the Flink Yarn application.");
- yarnClusterClient.shutDownCluster();
- yarnClusterClient.shutdown();
- }
- }
- }
- LOG.info("Finished testJavaAPI()");
- }
}
diff --git a/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNSessionFIFOSecuredITCase.java b/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNSessionFIFOSecuredITCase.java
index 97f60fc..d9a79b6 100644
--- a/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNSessionFIFOSecuredITCase.java
+++ b/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNSessionFIFOSecuredITCase.java
@@ -129,7 +129,4 @@ public class YARNSessionFIFOSecuredITCase extends YARNSessionFIFOITCase {
@Override
public void testfullAlloc() {}
-
- @Override
- public void testJavaAPI() {}
}