venkata91 commented on code in PR #23164:
URL: https://github.com/apache/flink/pull/23164#discussion_r1290513600
##########
flink-yarn/src/test/java/org/apache/flink/yarn/YarnApplicationFileUploaderTest.java:
##########
@@ -73,6 +74,34 @@ void testRegisterProvidedLocalResources(@TempDir File
flinkLibDir) throws IOExce
}
}
+ @Test
+ void testRegisterProvidedLocalResourcesWithParentDir(@TempDir File
flinkLibDir)
+ throws IOException {
+ final Map<String, String> filesWithParentDir = getFilesWithParentDir();
+
+ generateFilesInDirectory(flinkLibDir, filesWithParentDir);
+
+ try (final YarnApplicationFileUploader yarnApplicationFileUploader =
+ YarnApplicationFileUploader.from(
+ FileSystem.get(new YarnConfiguration()),
+ new Path(flinkLibDir.toURI()),
+ Collections.singletonList(new
Path(flinkLibDir.toURI())),
+ ApplicationId.newInstance(0, 0),
+ DFSConfigKeys.DFS_REPLICATION_DEFAULT)) {
+
+ List<String> classPath =
yarnApplicationFileUploader.registerProvidedLocalResources();
+
+ Set<String> expectedClassPathEntries = new HashSet<>();
+ for (String filePath : filesWithParentDir.keySet()) {
+ String parentDir = new Path(filePath).getParent().toString();
+ expectedClassPathEntries.add(parentDir);
+ expectedClassPathEntries.add(filePath);
+ }
+
+
assertThat(classPath).containsExactlyInAnyOrderElementsOf(expectedClassPathEntries);
Review Comment:
After making the above requested change, we should ensure the classpath is
in order as expected (which is sorted and also resource dirs come first)
--
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]