RFR: 8272369: java/io/File/GetXSpace.java failed with "RuntimeException: java.nio.file.NoSuchFileException: /run/user/0"

Brian Burkhalter bpb at openjdk.java.net
Tue Aug 17 15:35:28 UTC 2021


On Tue, 17 Aug 2021 02:48:35 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> This change proposes to exclude `/run/user` mounts from the test when run on Linux as they can "disappear" while the test is running.

There is no other occurrence of `df` in the `java/io` or the `java/nio` tests that I can find. The test `java/nio/file/FileStore/Basic.java` does however have this construct:


                // check space attributes are accessible
                try {
                    store.getTotalSpace();
                    store.getUnallocatedSpace();
                    store.getUsableSpace();
                } catch (NoSuchFileException nsfe) {
                    // ignore exception as the store could have been
                    // deleted since the iterator was instantiated
                    System.err.format("%s was not found\n", store);
                } catch (AccessDeniedException ade) {
                    // ignore exception as the lack of ability to access the
                    // store due to lack of file permission or similar does not
                    // reflect whether the space attributes would be accessible
                    // were access to be permitted
                    System.err.format("%s is inaccessible\n", store);
                }

which might be a better way to handle the current problem, i.e., don't filter out the `/run/user` mounts up front, but ignore the NSFE if it occurs on one of them

-------------

PR: https://git.openjdk.java.net/jdk/pull/5136


More information about the core-libs-dev mailing list