RFR: 8325199: (zipfs) jdk/nio/zipfs/TestPosix.java failed 6 sub-tests
Eirik Bjørsnøs
eirbjo at openjdk.org
Sun Feb 4 21:41:19 UTC 2024
Please review this PR which fixes an intermittent failure on Windows for the `TestPosix` test.
The recently introduced test `setPermissionsShouldConvertToUnix` fails to close the `FileSystem` returned by `createEmptyZipFile`. The solution is to move this call within the 'try-with-resources' statement, ensuring it gets properly closed.
Besides fixing the underlying file resource management issue, this PR also re-enables this test on Windows.
Since the author failed to realize that the method `createEmptyZipFile` returns an open FileSystem, this PR also suggests that we rename this method to `createEmptyZipFileSystem` in the hope that it will reduce future confusion.
-------------
Commit messages:
- Note that the caller is responsible for closing the FileSystem returned by createEmptyZipFileSystem
- Re-enable the setPermissionsShouldConvertToUnix test on Windows
- createEmptyZipFile returns an open FileSystem, make sure we close it in a try-with-resources
Changes: https://git.openjdk.org/jdk/pull/17702/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17702&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8325199
Stats: 13 lines in 2 files changed: 1 ins; 7 del; 5 mod
Patch: https://git.openjdk.org/jdk/pull/17702.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/17702/head:pull/17702
PR: https://git.openjdk.org/jdk/pull/17702
More information about the nio-dev
mailing list