Cleaning up in tests is always problematic, since tests
often run in environments where such cleaning actions
are not performed immediately. Just look at the hoops
that we go through to delete files ( and directories )
in  test/lib/jdk/test/lib/util/FileUtils.java, that I
added a few years ago. That said, we should try to clean
up whenever possible.

In this particular case the files in question are
created in the jtreg's scratch directory. If a test
fails it could be useful, for diagnostic purposes, to
inspect the contents of such files, no? Are these
files causing issues? How invasive a change would it be
to only delete the files if a test fails?

-Chris.


On 17/09/18 10:11, Langer, Christoph wrote:

...

On 2018/9/17 4:25 PM, Langer, Christoph wrote:
Hi Hamlin,

wouldn't it be better/cleaner to move the deletion of files into finally
blocks? But I guess one can do it with deleteOnExit() as well...

Best regards
Christoph

-----Original Message-----
From: net-dev <net-dev-boun...@openjdk.java.net> On Behalf Of
Hamlin Li
Sent: Montag, 17. September 2018 07:55
To: OpenJDK Network Dev list <net-dev@openjdk.java.net>
Subject: RFR of JDK-8210802,temp files left by tests in
jdk/java/net/httpclient

Would you please review the following patch?

bug: https://bugs.openjdk.java.net/browse/JDK-8210802
webrev: http://cr.openjdk.java.net/~mli/8210802/webrev.00/

Thank you
-Hamlin

Reply via email to