KAFKA-17575 Remove unnecessary file.deleteOnExit call (#17226)

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 <kitingiao@gmail.com>, Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
Stig Døssing 2024-09-23 14:28:08 +02:00 committed by GitHub
parent d063443825
commit a407cc3a31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 0 additions and 1 deletions

View File

@ -268,7 +268,6 @@ public class TestUtils {
} catch (final IOException ex) { } catch (final IOException ex) {
throw new RuntimeException("Failed to create a temp dir", ex); throw new RuntimeException("Failed to create a temp dir", ex);
} }
file.deleteOnExit();
Exit.addShutdownHook("delete-temp-file-shutdown-hook", () -> { Exit.addShutdownHook("delete-temp-file-shutdown-hook", () -> {
try { try {