You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "soarez (via GitHub)" <gi...@apache.org> on 2024/02/14 14:53:28 UTC
Re: [PR] MINOR: Cleanup log.dirs in ReplicaManagerTest on JVM exit [kafka]
soarez commented on code in PR #15289:
URL: https://github.com/apache/kafka/pull/15289#discussion_r1489605994
##########
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:
Do we need both `parentFile.deleteOnExit()` and `Utils.delete(parentFile)` on the shutdown hook?
--
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