RFR: 8298619: java/io/File/GetXSpace.java is failing
Brian Burkhalter
bpb at openjdk.org
Tue Feb 14 16:34:49 UTC 2023
On Sun, 12 Feb 2023 09:34:37 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>>> It seems a bit fragile to be parsing the output of `fsutil volume diskFree` as the output seems to vary by Windows releases and maybe configuration. So minimally, I think it should be changed to use ProcessTools so that the command and the output show up in the .jtr file.
>>>
>>> In passing, you might want to choose a different method name to make it clearer what it does, maybe volumeDiskFree?
>>
>> Another possibility would be to add a native method to the test itself to invoke [GetDiskSpaceInformationW](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getdiskspaceinformationw) to obtain the value of `CallerTotalAllocationUnits` (in bytes) from the [DISK_SPACE_INFORMATION](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/ns-fileapi-disk_space_information) structure.
>
>> Another possibility would be to add a native method to the test itself to invoke [GetDiskSpaceInformationW](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getdiskspaceinformationw) to obtain the value of `CallerTotalAllocationUnits` (in bytes) from the [DISK_SPACE_INFORMATION](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/ns-fileapi-disk_space_information) structure.
>
> That would be more reliable than parsing the output of `fsutil volume` so worth trying. You might have to dig into which of these win32 works with quotas as that seems to be part of the issue. The JDK uses GetDiskFreeSpaceExW. Also this test might have to do a few iterations so that it captures free space info while the system is in quiescence - I suspect some of the reliability issues has been concurrent activity that changes the volume space usage significantly while this test is running.
There has definitely been a problem with quotas on Windows. I set up quotas on actual Windows 11 hardware and replicated the same failure. I am not sure how much lack of system quiescence is to blame, but there would be no harm in building in some robustness for lack of quiescence while we're at it.
-------------
PR: https://git.openjdk.org/jdk/pull/12397
More information about the core-libs-dev
mailing list