RFR: 8351010: Test java/io/File/GetXSpace.java failed: / usable space 56380809216 > free space 14912244940

Brian Burkhalter bpb at openjdk.org
Mon Jun 9 21:08:49 UTC 2025


On Mon, 9 Jun 2025 21:03:27 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Relax testing the inequality `usable_space <= free_space` to testing the inequality `usable_space <= total_space`.

Although the native system call `statfs` (Unix) and native function `GetDiskFreeSpaceExW` (Windows) might collect the space values atomically at a given instant, the space values returned by `getFreeSpace` and `getUsableSpace` are obtained at two distinct times, hence the state of the file system might have changed in the intervening interval, and the inequality `usable_space <= free_space` cannot be reliably tested in a deterministic manner. This has caused many failures in the `GetXSpace` test, so it seems reasonable to relax the constrain to `usable_space <= free_space`. Other statistical methods could be used to test the original inequality `usable_space <= free_space`, but they all admit to some degree of randomness as to how much the file system might change in a small interval of time and are therefore open to (likely spurious) failures.

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

PR Comment: https://git.openjdk.org/jdk/pull/25704#issuecomment-2957031060


More information about the core-libs-dev mailing list