JDK 9 RFR of 8160220: (fs) Tests in jdk/test/java/nio/file/WatchService leave directory trees behind

Chris Hegarty chris.hegarty at oracle.com
Tue Jul 12 19:17:50 UTC 2016


> On 12 Jul 2016, at 18:51, Brian Burkhalter <Brian.Burkhalter at oracle.com> wrote:
> 
> On Jul 12, 2016, at 9:57 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 
>>>> The tests in this area use TestUtil.removeAll so you don't need to add deleteFileTree. Also if you expand the scope of the try/finally then you can get rid of deleteOnExit.
>>> 
>>> The change for https://bugs.openjdk.java.net/browse/JDK-8160687showed that LotsOfCancels was leaving files around before this change so there must be something else going on which needs to be identified.
>>> 
>> Yes, I suspect there was a VM crash at some point in the VM that happen to have run this test. The main issue with agentvm mode is that it runs many tests before it exists and so the delete-on-exit list builds up.
> 
> It does not sound as if it is the best idea to rely on deleteOnExit().

I cannot find it now, but I added a comment to the same affect, to a recent
similar issue.  If you are going to explicitly delete the file / dir, please use
one of the appropriate utilities in jdk.testlibrary.FileUtils.

-Chris.


More information about the nio-dev mailing list