qinf commented on code in PR #23191:
URL: https://github.com/apache/flink/pull/23191#discussion_r1289968184
##########
flink-yarn/src/test/java/org/apache/flink/yarn/YarnClusterDescriptorTest.java:
##########
@@ -672,6 +672,30 @@ void testShipUsrLib() throws IOException {
}
}
+ /** Tests that the {@code YarnConfigOptions.SHIP_ARCHIVES} only supports
archive files. */
+ @Test
+ void testShipArchives() throws IOException {
+ final File homeFolder =
+ Files.createTempDirectory(temporaryFolder,
UUID.randomUUID().toString()).toFile();
+ File dir1 = new File(homeFolder.getPath(), "dir1");
+ File archive1 = new File(homeFolder.getPath(), "archive1.zip");
+ File archive2 = new File(homeFolder.getPath(), "archive2.zip");
+ assertThat(dir1.createNewFile()).isTrue();
+ assertThat(archive1.createNewFile()).isTrue();
+ assertThat(archive2.createNewFile()).isTrue();
+ Configuration flinkConfiguration = new Configuration();
+ flinkConfiguration.set(YarnConfigOptions.SHIP_ARCHIVES,
+ Arrays.asList(dir1.getAbsolutePath(),
archive1.getAbsolutePath()));
+
+ assertThrows("Not all files included in shipArchives are archive
files.",
+ IllegalArgumentException.class,
+ () -> createYarnClusterDescriptor(flinkConfiguration));
+
+ flinkConfiguration.set(YarnConfigOptions.SHIP_ARCHIVES,
+ Arrays.asList(archive1.getAbsolutePath(),
archive2.getAbsolutePath()));
+ createYarnClusterDescriptor(flinkConfiguration);
Review Comment:
@1996fanrui done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]