FrankChen021 commented on code in PR #19822:
URL: https://github.com/apache/druid/pull/19822#discussion_r3698986499


##########
processing/src/test/java/org/apache/druid/segment/IndexMergerV9WithSpatialIndexTest.java:
##########
@@ -476,8 +470,8 @@ private static QueryableIndex makeMergedQueryableIndex(
       }
 
 
-      File tmpFile = File.createTempFile("yay", "who");
-      tmpFile.delete();
+      final File tmpFile = FileUtils.createTempDir("spatial-index-merge");
+      tmpFile.deleteOnExit();

Review Comment:
   [P2] Recursively clean the persisted index trees
   
   `File.deleteOnExit()` only deletes an empty path; it does not recursively 
delete directory contents. These roots and child directories contain persisted 
segment files, none of which are registered for deletion, so every shutdown 
deletion fails. The same issue occurs at line 260, causing each test JVM run to 
leave all generated spatial indexes under the system temp directory. Retain the 
indexes through the tests, then close them and call `FileUtils.deleteDirectory` 
from explicit class-level teardown.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to