[ 
https://issues.apache.org/jira/browse/FLINK-10666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16691351#comment-16691351
 ] 

ASF GitHub Bot commented on FLINK-10666:
----------------------------------------

zentol closed pull request #6919: [FLINK-10666] [tests] Port 
YarnClusterDescriptorTest to new codebase
URL: https://github.com/apache/flink/pull/6919
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/flink-yarn/src/test/java/org/apache/flink/yarn/YarnClusterDescriptorTest.java 
b/flink-yarn/src/test/java/org/apache/flink/yarn/YarnClusterDescriptorTest.java
index f206b6678cf..b53fd3164e2 100644
--- 
a/flink-yarn/src/test/java/org/apache/flink/yarn/YarnClusterDescriptorTest.java
+++ 
b/flink-yarn/src/test/java/org/apache/flink/yarn/YarnClusterDescriptorTest.java
@@ -57,7 +57,7 @@
 import static org.junit.Assert.fail;
 
 /**
- * Tests for the {@link LegacyYarnClusterDescriptor}.
+ * Tests for the {@link YarnClusterDescriptor}.
  */
 public class YarnClusterDescriptorTest extends TestLogger {
 
@@ -91,11 +91,10 @@ public static void tearDownClass() {
 
        @Test
        public void testFailIfTaskSlotsHigherThanMaxVcores() throws 
ClusterDeploymentException {
-
                final Configuration flinkConfiguration = new Configuration();
                
flinkConfiguration.setInteger(ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_MIN,
 0);
 
-               LegacyYarnClusterDescriptor clusterDescriptor = new 
LegacyYarnClusterDescriptor(
+               YarnClusterDescriptor clusterDescriptor = new 
YarnClusterDescriptor(
                        flinkConfiguration,
                        yarnConfiguration,
                        temporaryFolder.getRoot().getAbsolutePath(),
@@ -132,7 +131,7 @@ public void testConfigOverwrite() throws 
ClusterDeploymentException {
                configuration.setInteger(YarnConfigOptions.VCORES, 
Integer.MAX_VALUE);
                
configuration.setInteger(ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_MIN, 
0);
 
-               LegacyYarnClusterDescriptor clusterDescriptor = new 
LegacyYarnClusterDescriptor(
+               YarnClusterDescriptor clusterDescriptor = new 
YarnClusterDescriptor(
                        configuration,
                        yarnConfiguration,
                        temporaryFolder.getRoot().getAbsolutePath(),
@@ -166,7 +165,7 @@ public void testConfigOverwrite() throws 
ClusterDeploymentException {
        @Test
        public void testSetupApplicationMasterContainer() {
                Configuration cfg = new Configuration();
-               LegacyYarnClusterDescriptor clusterDescriptor = new 
LegacyYarnClusterDescriptor(
+               YarnClusterDescriptor clusterDescriptor = new 
YarnClusterDescriptor(
                        cfg,
                        yarnConfiguration,
                        temporaryFolder.getRoot().getAbsolutePath(),
@@ -417,14 +416,12 @@ public void testSetupApplicationMasterContainer() {
         */
        @Test
        public void testExplicitLibShipping() throws Exception {
-               AbstractYarnClusterDescriptor descriptor = new 
LegacyYarnClusterDescriptor(
+               try (YarnClusterDescriptor descriptor = new 
YarnClusterDescriptor(
                        new Configuration(),
                        yarnConfiguration,
                        temporaryFolder.getRoot().getAbsolutePath(),
                        yarnClient,
-                       true);
-
-               try {
+                       true)) {
                        descriptor.setLocalJarPath(new 
Path("/path/to/flink.jar"));
 
                        File libFile = temporaryFolder.newFile("libFile.jar");
@@ -450,8 +447,6 @@ public void testExplicitLibShipping() throws Exception {
                        Assert.assertEquals(2, descriptor.shipFiles.size());
                        
Assert.assertTrue(descriptor.shipFiles.contains(libFile));
                        
Assert.assertTrue(descriptor.shipFiles.contains(libFolder));
-               } finally {
-                       descriptor.close();
                }
        }
 
@@ -460,14 +455,12 @@ public void testExplicitLibShipping() throws Exception {
         */
        @Test
        public void testEnvironmentLibShipping() throws Exception {
-               AbstractYarnClusterDescriptor descriptor = new 
LegacyYarnClusterDescriptor(
+               try (YarnClusterDescriptor descriptor = new 
YarnClusterDescriptor(
                        new Configuration(),
                        yarnConfiguration,
                        temporaryFolder.getRoot().getAbsolutePath(),
                        yarnClient,
-                       true);
-
-               try {
+                       true)) {
                        File libFolder = 
temporaryFolder.newFolder().getAbsoluteFile();
                        File libFile = new File(libFolder, "libFile.jar");
                        libFile.createNewFile();
@@ -490,8 +483,6 @@ public void testEnvironmentLibShipping() throws Exception {
                        
Assert.assertTrue(effectiveShipFiles.contains(libFolder));
                        
Assert.assertFalse(descriptor.shipFiles.contains(libFile));
                        
Assert.assertFalse(descriptor.shipFiles.contains(libFolder));
-               } finally {
-                       descriptor.close();
                }
        }
 
@@ -500,7 +491,7 @@ public void testEnvironmentLibShipping() throws Exception {
         */
        @Test
        public void testYarnClientShutDown() {
-               LegacyYarnClusterDescriptor yarnClusterDescriptor = new 
LegacyYarnClusterDescriptor(
+               YarnClusterDescriptor yarnClusterDescriptor = new 
YarnClusterDescriptor(
                        new Configuration(),
                        yarnConfiguration,
                        temporaryFolder.getRoot().getAbsolutePath(),
@@ -515,7 +506,7 @@ public void testYarnClientShutDown() {
                closableYarnClient.init(yarnConfiguration);
                closableYarnClient.start();
 
-               yarnClusterDescriptor = new LegacyYarnClusterDescriptor(
+               yarnClusterDescriptor = new YarnClusterDescriptor(
                        new Configuration(),
                        yarnConfiguration,
                        temporaryFolder.getRoot().getAbsolutePath(),


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Port YarnClusterDescriptorTest to new codebase
> ----------------------------------------------
>
>                 Key: FLINK-10666
>                 URL: https://issues.apache.org/jira/browse/FLINK-10666
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Tests
>    Affects Versions: 1.7.0
>            Reporter: TisonKun
>            Assignee: TisonKun
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.8.0
>
>
> Port {{YarnClusterDescriptorTest}} to new codebase.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to