On Mon, 9 Jun 2025 21:03:27 GMT, Brian Burkhalter <b...@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

Reply via email to