RFR: 8368846: java/io/File/createTempFile/TargetDirectory fails when run by root user
Brian Burkhalter
bpb at openjdk.org
Wed Oct 8 23:34:05 UTC 2025
On Mon, 29 Sep 2025 08:28:38 GMT, Francesco Andreuzzi <fandreuzzi at openjdk.org> wrote:
> The test checks whether writing to a read-only directory throws a `IOException`. This test is not applicable when the user running the test is root. Thus, I propose to skip it.
>
> I converted the class to several JUnit tests, so we can use `@DisabledIf`.
test/jdk/java/io/File/createTempFile/TargetDirectory.java line 54:
> 52: class TargetDirectory {
> 53:
> 54: @TempDir
In my testing I saw this output for each of the four sub-tests:
INFO: Skipping cleanup of temp dir [...] for field TargetDirectory.tempDir due to CleanupMode.NEVER.
Should this have `CleanupMode.ALWAYS`? In the old version of the test there were explcit calls to `File.delete`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27542#discussion_r2415232784
More information about the core-libs-dev
mailing list