Skip to content

Commit

Permalink
KAFKA-17575 Remove unnecessary file.deleteOnExit call (apache#17226)
Browse files Browse the repository at this point in the history
TestUtils.tempDirectory already registers a shutdown hook for deleting the temp directory. There's no reason to also call File.deleteOnExit, since that just registers another hook to do the same thing.

Reviewers: TengYao Chi <[email protected]>, Ken Huang <[email protected]>, Chia-Ping Tsai <[email protected]>
  • Loading branch information
srdo authored Sep 23, 2024
1 parent d063443 commit a407cc3
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion clients/src/test/java/org/apache/kafka/test/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ public static File tempDirectory(final Path parent, String prefix) {
} catch (final IOException ex) {
throw new RuntimeException("Failed to create a temp dir", ex);
}
file.deleteOnExit();

Exit.addShutdownHook("delete-temp-file-shutdown-hook", () -> {
try {
Expand Down

0 comments on commit a407cc3

Please sign in to comment.