You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/11/21 23:54:28 UTC

[GitHub] [kafka] gharris1727 commented on a diff in pull request #12805: KAFKA-12610: Implement PluginClassLoader::getResource

gharris1727 commented on code in PR #12805:
URL: https://github.com/apache/kafka/pull/12805#discussion_r1028619236


##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/isolation/DelegatingClassLoaderTest.java:
##########
@@ -118,7 +119,8 @@ public void testLoadingMixOfValidAndInvalidPlugins() throws Exception {
 
         for (String sourceJar : TestPlugins.pluginPath()) {
             Path source = new File(sourceJar).toPath();
-            Files.copy(source, pluginPath.resolve(source.getFileName()));
+            Files.copy(source, pluginPath.resolve(source.getFileName()),
+                    StandardCopyOption.REPLACE_EXISTING);

Review Comment:
   Removing it doesn't seem to cause the test to fail, so I don't think it's necessary for the test to pass.
   
   I believe you're correct that the pluginDir is cleaned up and won't have stale values from previous executions. A name collision may happen in other situations, none of which appear to be happening in this test:
   * A test plugin produces an `invalid.jar` file that collides with the empty file created earlier in the test
   * Two or more test plugins produce jar files with the same name
   
   This may also have been necessary at some stage of development and then obviated earlier in the review.
   
   I'll remove this change for clarity of the diff.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org