RFR: 8292206: TestCgroupMetrics.java fails as getMemoryUsage() is lower than expected
Ioi Lam
iklam at openjdk.org
Wed Dec 21 20:49:24 UTC 2022
On Tue, 20 Dec 2022 10:44:35 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
> > I am removing this test scenario for now as I don't see it providing any actual value.
>
> I disagree. It seems useful in the docker/container case as there are APIs in the JDK reporting those metrics and it wouldn't be tested otherwise.
>
> Note that this test is also being used by `TestSystemMetrics.java`. Entrypoint in the `TestSystemMetrics` case is `main()` (over entrypoint `testAll()` via `TestCgroupMetrics`).
>
> > If we want to have more in-depth functional tests for the `Metrics.getMemoryXXX()` APIs, we need to do it inside a container in a more controlled setting.
>
> That's what the above mentioned `TestSystemMetrics.java` does. I take it that test is not problematic? If so, we should just not invoke `testMemoryUsage()` when invoked from `TestCgroupMetrics`.
Thanks for your review. I've disabled the `testMemorySubsystem()` and `testMemoryUsage()` scenarios only when testing outside of containers (in TestCgroupMetrics.java). These scenarios will be executed by TestSystemMetrics.java, which is executed in a container.
-------------
PR: https://git.openjdk.org/jdk/pull/11734
More information about the hotspot-runtime-dev
mailing list