RFR: 8321931: memory_swap_current_in_bytes reports 0 as "unlimited" [v5]
Gerard Ziemski
gziemski at openjdk.org
Tue Jan 23 16:28:30 UTC 2024
On Mon, 22 Jan 2024 20:34:31 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
> > This bug fix is correcting the behavior where `0` should be displayed instead of `unlimited`. Strictly speaking that's all we need to test here. The test I proposed uses an approach that is flexible enough in case that this value happens to be greater than `0` in the future for any reason.
>
> I disagree. What you are looking for is if the actual value is `0` you want `memory_swap_current_in_bytes` to report `0`. The test you have might end up running with any number `> 0` in the interface file, and your test would spuriously pass even with the actual bug present (since `unlimited` would not occur in this case). The only way to actually ensure you get `0` is by running the test in a container with swap turned off.
As long as the test gets run in an environment where we do get `0` at least some times, we are fine, but you are correct: to guarantee that we test the right thing, we would need to setup the container properly.
I feel like I don't have enough container knowledge to write such a test, without investing more time learning the basics. Would you kindly help and write the test you want please? At least the part that sets up the environment and starts the test (on Linux only?) with swap==0 ?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17314#issuecomment-1906430892
More information about the hotspot-runtime-dev
mailing list