[OpenJDK 2D-Dev] [10]JDK-8183341:Better cleanup for javax/imageio/AllowSearch.java

Prahalad Kumar Narayanan prahalad.kumar.narayanan at oracle.com
Tue Jul 11 11:27:26 UTC 2017

Hello Sashi

Good day to you.

I looked into the changes. Here are my suggestions
. You are deleting the files with Files.delete(filePath) only when the test succeeds
  Shouldn't you delete the temp file upon failure as well ? (before throwing RuntimeException in Line 70)

Besides, the nature of the bug and the proposed fix are similar to- 
JDK-8183349: Better cleanup for jdk/test/javax/imageio/plugins/shared/CanWriteSequence.java and WriteAfterAbort.java.

The test cases corresponding to both the bugs use- File.deleteOnExit APIs.
. As per the documentation- the API "Requests" deletion of the indicated file upon "normal termination" of the VM.
. Since the spec doesn't guarantee the deletion (only requests), I think changes to the test source should be ok.

. However, I 'm curious to know-
      . Was the bug reproducible at your end ?
      . If yes, was it reproducible when the test succeeded /or when the test failed ?
      . Is there a difference in the VM's termination based on the outcome of the test case.
      . How many such test cases exist that need similar clean up ?
            . grep on 'deleteOnExit' within jdk/test/javax/imageio/ gives me atleast 10 instances.
            . grep on 'File.createTempFile' within same directory gives me 29 instances.

Thank you
Have a good day

Prahalad N.

From: Shashidhara Veerabhadraiah 
Sent: Tuesday, July 11, 2017 3:05 PM
To: 2d-dev at openjdk.java.net; Philip Race; Prasanta Sadhukhan
Subject: [OpenJDK 2D-Dev] [10]JDK-8183341:Better cleanup for javax/imageio/AllowSearch.java

Hi All,
Please review a fix for a test bug which was not cleaning up the temporary test files that it used to create.
The issue with this test was that the test used to create temporary files but not deleting them.
The updated test file does the deletion of the temporary files that the test is creating.
Note: The user had requested to create the temporary files in user.dir. But I think it is good to create the temporary files in the system temp directory and use it for testing and later delete the same. Besides if required the user has the choice to change the temp directory to the directory they wish for.
Thanks and regards,

More information about the 2d-dev mailing list