RFR: 8236617: jtreg test containers/docker/TestMemoryAwareness.java fails after 8226575

Doerr, Martin martin.doerr at sap.com
Thu Jan 2 13:46:51 UTC 2020


Hi Matthias,

thanks for fixing it.

I suggest to put "Your kernel does not support swap limit capabilities or the cgroup is not mounted" into a String instead of having it 3 times.

Looks good to me otherwise.

Best regards,
Martin


> -----Original Message-----
> From: hotspot-dev <hotspot-dev-bounces at openjdk.java.net> On Behalf Of
> Baesken, Matthias
> Sent: Donnerstag, 2. Januar 2020 14:26
> To: 'hotspot-dev at openjdk.java.net' <hotspot-dev at openjdk.java.net>
> Subject: RFR: 8236617: jtreg test
> containers/docker/TestMemoryAwareness.java fails after 8226575
> 
> Hello, please review this small adjustment to  jtreg test
> containers/docker/TestMemoryAwareness.java .
> 
> After change   "8226575: OperatingSystemMXBean should be made container
> aware"    has been pushed,
> we observe failures on linux s390x / ppc64le in the docker related jtreg tests
> .
> 
> 
> The test runs into  the following error :
> java.lang.RuntimeException:
> 'OperatingSystemMXBean.getTotalSwapSpaceSize: 52428800' missing from
> stdout/stderr
> 
> at
> jdk.test.lib.process.OutputAnalyzer.shouldContain(OutputAnalyzer.java:187)
> at
> TestMemoryAwareness.testOperatingSystemMXBeanAwareness(TestMem
> oryAwareness.java:154)
> at TestMemoryAwareness.main(TestMemoryAwareness.java:65)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMet
> hodAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Delega
> tingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:564)
> at
> com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapp
> er.java:127)
> at java.base/java.lang.Thread.run(Thread.java:832)
> 
> 
> The reason is that the value found is instead
> OperatingSystemMXBean.getTotalSwapSpaceSize: -104857600    .
> When looking into the getTotalSwapSpaceSize() function, we get values of 0
> for "limit" and 104857600 for "memLimit" :
> 
> 57 long limit = containerMetrics.getMemoryAndSwapLimit();
>  ....
> 62 long memLimit = containerMetrics.getMemoryLimit();
> 63 if (limit >= 0 && memLimit >= 0) {
> 64 return limit - memLimit;
> 65 }
> 
> That explains the value "-104857600" . We see messages    "Your kernel does
> not support swap limit capabilities or the cgroup is not mounted. Memory
> limited without swap" , this most likely
> causes the unexpected limit == 0  value  .
> 
> 
> Bug/webrev :
> 
> https://bugs.openjdk.java.net/browse/JDK-8236617
> 
> http://cr.openjdk.java.net/~mbaesken/webrevs/8236617.0/
> 
> 
> Thanks, Matthias


More information about the hotspot-dev mailing list