JDK-8315960 : test/jdk/java/io/File/TempDirDoesNotExist.java leaves test files behind
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 21,22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2023-09-08
  • Updated: 2023-11-01
  • Resolved: 2023-09-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21 JDK 22
21.0.2Fixed 22 b17Fixed
Related Reports
Relates :  
Description
test/jdk/java/io/File/TempDirDoesNotExist.java creates temp files in 
  System.getProperty("user.home")
using:
  File.createTempFile("prefix", ".suffix");

There is no finally block in the test to delete the TempFile later.

After a few weeks of running tests this leaves test systems with many prefix*.suffix files littering the user home directory.

This test also appears to be one which would benefit from conversion to JUnit 5.
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk21u/pull/246 Date: 2023-10-12 07:24:09 +0000
12-10-2023

[jdk21u-fix-request] Approval Request from Aleksey Shipilëv Fixes the littering test. Applies cleanly. Checked that littering does not happen anymore.
12-10-2023

Changeset: 373cdf25 Author: Brian Burkhalter <bpb@openjdk.org> Date: 2023-09-22 17:24:05 +0000 URL: https://git.openjdk.org/jdk/commit/373cdf257de78940b2e55e9f5fc38b6233561baf
22-09-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/15757 Date: 2023-09-14 21:53:30 +0000
14-09-2023