ijuma commented on code in PR #15289: URL: https://github.com/apache/kafka/pull/15289#discussion_r1518649065
########## clients/src/test/java/org/apache/kafka/test/TestUtils.java: ########## @@ -195,6 +195,25 @@ public static File tempDirectory() { return tempDirectory(null); } + /** + * Create a temporary directory under the given root directory. + * The root directory is removed on JVM exit if it doesn't already exist + * when this function is invoked. + * + * @param root path to create temporary directory under + * @return + */ + public static File tempRelativeDir(String root) { + File rootFile = new File(root); + boolean created = rootFile.mkdir(); + + File result = tempDirectory(rootFile.toPath(), null); + if (created) { + rootFile.deleteOnExit(); Review Comment: This is not enough to ensure the file is removed - it will only happen if the directory is empty. -- 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