RFR: 8264524: jdk/internal/platform/docker/TestDockerMemoryMetrics.java fails due to OOM killed
Jie Fu
jiefu at openjdk.java.net
Wed Mar 31 23:53:19 UTC 2021
On Wed, 31 Mar 2021 17:14:32 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
>> Hi all,
>>
>> jdk/internal/platform/docker/TestDockerMemoryMetrics.java fails on some of our testing platforms.
>> This is because testMemoryFailCount [1] fails due to OOM killed.
>> This test fails to avoid OOM killed [2] if memory.failcnt is always 0.
>>
>> The fix will print "Not OOM killed" if OOM killed doesn't happen.
>> And also fix another bug if the test get returned here [3].
>>
>> Testing:
>> - jdk/internal/platform/docker/ hotspot/jtreg/containers on Linux/x64
>>
>> Thanks.
>> Best regards,
>> Jie
>>
>> [1] https://github.com/openjdk/jdk/blob/master/test/jdk/jdk/internal/platform/docker/TestDockerMemoryMetrics.java#L80
>> [2] https://github.com/openjdk/jdk/blob/master/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java#L87
>> [3] https://github.com/openjdk/jdk/blob/master/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java#L96
>
> 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?
Thanks @jerboaa for your review.
Test output when failing is just:
[failcount]
It doesn't enter line 91 of test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java.
I assume memory.failcnt has been disabled on these platforms since it's always 0.
What about checking the value of memory.failcnt after testMemoryFailCount like:
// check after testMemoryFailCount()
if (memory.failcnt is zero) {
// memory.failcnt has been disabled
pass
} else {
// a broken implementation of Metrics.systemMetrics().getMemoryFailCount()
fail
}
Thanks.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3286
More information about the hotspot-runtime-dev
mailing list