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

Matthias Baesken mbaesken at openjdk.org
Fri Jul 1 15:33:43 UTC 2022


On Thu, 30 Jun 2022 16:14:50 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

>> 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

Looks like changing  GRUB_CMDLINE_LINUX_DEFAULT / GRUB_CMDLINE_LINUX in /etc/default/grub file
by adding   cgroup_enable=memory swapaccount=1
can solve the issue on Linux ppc64le machines (see https://www.suse.com/support/kb/doc/?id=000018585 ).
I am still not sure why this was not needed on our Linux x86_64 machines.

Without this added setting, 'docker info' showed :
WARNING: No swap limit support

With this setting, the warning is gone.

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

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


More information about the hotspot-runtime-dev mailing list