gaurav-narula commented on code in PR #15289:
URL: https://github.com/apache/kafka/pull/15289#discussion_r1507510343


##########
core/src/test/scala/unit/kafka/utils/TestUtils.scala:
##########
@@ -137,7 +137,18 @@ object TestUtils extends Logging {
     val parentFile = new File(parent)
     parentFile.mkdirs()
 
-    JTestUtils.tempDirectory(parentFile.toPath, null)
+    val result = JTestUtils.tempDirectory(parentFile.toPath, null)
+
+    parentFile.deleteOnExit()
+    Exit.addShutdownHook("delete-temp-log-dir-on-exit", {
+      try {
+        Utils.delete(parentFile)

Review Comment:
   Good point - turns we can just use `parentFile.deleteOnExit()`. Updated in 
[394f2e3](https://github.com/apache/kafka/pull/15289/commits/394f2e30e3ac2110921f8e1ea2978c405194a11b)



##########
core/src/test/scala/unit/kafka/utils/TestUtils.scala:
##########
@@ -137,7 +137,18 @@ object TestUtils extends Logging {
     val parentFile = new File(parent)
     parentFile.mkdirs()
 
-    JTestUtils.tempDirectory(parentFile.toPath, null)
+    val result = JTestUtils.tempDirectory(parentFile.toPath, null)
+
+    parentFile.deleteOnExit()
+    Exit.addShutdownHook("delete-temp-log-dir-on-exit", {
+      try {
+        Utils.delete(parentFile)

Review Comment:
   Good point - turns out we can just use `parentFile.deleteOnExit()`. Updated 
in 
[394f2e3](https://github.com/apache/kafka/pull/15289/commits/394f2e30e3ac2110921f8e1ea2978c405194a11b)



-- 
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-unsubscr...@kafka.apache.org

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

Reply via email to