RFR: 8264524: jdk/internal/platform/docker/TestDockerMemoryMetrics.java fails due to swapping not working [v2]

Jie Fu jiefu at openjdk.java.net
Fri Apr 2 04:13:31 UTC 2021


On Thu, 1 Apr 2021 04:44:48 GMT, Jie Fu <jiefu at openjdk.org> wrote:

>> test/jdk/jdk/internal/platform/docker/TestDockerMemoryMetrics.java line 120:
>> 
>>> 118:                 oa.shouldHaveExitValue(0).shouldContain("TEST PASSED!!!");
>>> 119:             }
>>> 120:         }
>> 
>> Consider a broken implementation of `Metrics.systemMetrics().getMemoryFailCount()`. Wouldn't the test now (falsely) pass?
>> 
>> What is the actual test output on those systems where the test fails? There should be a docker log file. Does it enter line 91?
>
> Hi @jerboaa ,
> 
> After more thinking, I think the reason why memory.failcnt is always 0 is that there is no swap space on the host machine.
> So the testMemoryFailCount should be skipped in that case.
> 
> But is there any API which can be used to get the swap space size of the host machine?
> 
> Thanks.

> Consider a broken implementation of `Metrics.systemMetrics().getMemoryFailCount()`. Wouldn't the test now (falsely) pass?

Hi @jerboaa ,

A pre-test run has been added to check whether swapping really works for testMemoryFailCount.
Swapping should be OK for memory.failcnt testing otherwise it will fail due to OOM killed.

What do you think?
Thanks.

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

PR: https://git.openjdk.java.net/jdk/pull/3286


More information about the hotspot-runtime-dev mailing list