8224617: (fs) java/nio/file/FileStore/Basic.java found filesystem twice

Alan Bateman Alan.Bateman at oracle.com
Sun May 26 08:58:28 UTC 2019


On 25/05/2019 00:39, Brian Burkhalter wrote:
> https://bugs.openjdk.java.net/browse/JDK-8224617
> http://cr.openjdk.java.net/~bpb/8224617/webrev.00/
>
> The proposed change adds a method “checkMountPoints()” to the FileUtils test library class and in FileStore/Basic.java replaces the use of FileUtils.areFileSystemsAccessible() with the new method. The new method accomplishes the same thing as areFileSystemsAccessible() but additionally checks that there are not duplicate mount points on the system. This latter would indicate a file system misconfiguration which would formerly have appeared as a FileStore failure but with the present change is flagged explicitly as a system configuration problem.
The approach looks okay although 90s is a long time for a test to wait 
for `df` to complete. Also I'm not sure that checkMountPoints is the 
best name for a method that returns a boolean to indicate if the file 
systems are usable for testing. Something like 
areAllMountPointsAccessible() might be more obvious when reading the test.

>
> One question about the new code is whether the test at lines 269-279 of the new version of FileUtils should not assume that duplicates occur in succession in the output of ‘df.’ (This is assumed in Basic in the testing for dulicate FileStores). An alternative would be to accumulate each new non-null entry into a Set and check whether adding the entry actually changed the Set. If it did not then there is a duplicate.
>
Are there any scenarios where FileSystem::getFileStores should ignore 
the duplicates?

-Alan


More information about the nio-dev mailing list