On Mon, 18 Mar 2024 16:47:24 GMT, Bill Huang <bhu...@openjdk.org> wrote:

> This task addresses an essential aspect of our testing infrastructure: the 
> proper handling and cleanup of temporary files and socket files created 
> during test execution. The motivation behind these changes is to prevent the 
> accumulation of unnecessary files in the default temporary directory, which 
> can affect the system's storage and potentially influence subsequent test 
> runs.
> 
> Our review identified that several tests create temporary files or socket 
> files without ensuring their removal post-execution. 
> - Direct calls to java.io.File.createTempFile and 
> java.nio.file.Files.createTempFile without adequate cleanup.
> - Tests using NIO socket channels with StandardProtocolFamily.UNIX, not 
> explicitly removing socket files post-use.

test/jdk/java/nio/channels/unixdomain/Bind.java line 191:

> 189:             server.bind(null);
> 190:             UnixDomainSocketAddress usa = 
> (UnixDomainSocketAddress)server.getLocalAddress();
> 191:             usa.getPath().toFile().deleteOnExit();

The test already deletes the file, I think you just want a try-finally here, 
same comment on a few other tests.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18352#discussion_r1529408542

Reply via email to