RFR: JDK-8289146: containers/docker/TestMemoryWithCgroupV1.java fails on linux ppc64le machine with missing Memory and Swap Limit output

Severin Gehwolf sgehwolf at openjdk.org
Thu Jun 30 16:18:39 UTC 2022


On Thu, 30 Jun 2022 14:56:48 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> Hi  Ioi, I think I proposed something like this (testing for the "Your kernel does not support memory swappiness" string) at other places in the test-code where the issue caused us trouble but this was not liked so much.
>
> I don't know why that wasn't liked. Your patch essentially reduces `testMemoryLimitWithSwappiness` to test for only this:
> 
> 
> out.shouldMatch("Memory and Swap Limit is: [0-9]+");
> 
> 
> So if we go with this way, you may as well remove everything inside the `try` block.

The issue with asserting a specific error from a container engine is that it might be different from one (`docker`) to the other (`podman`). Another way to address this, could be to pre-assert that on systems where this is happening (no swap), to skip the test. I.e. along the lines of:


docker run --memory 100 --memory-swap 200

and inside a container have this code:


if (metrics.getMemoryAndSwapLimit() == metrics.getMemoryLimit()) {
   // system doesn't support swap, skip test
}


Basically akin to: https://github.com/openjdk/jdk/blob/master/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV1.java#L283..L284

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

PR: https://git.openjdk.org/jdk/pull/9319


More information about the hotspot-runtime-dev mailing list