JDK-8240189 : [TESTBUG] Some cgroup tests are failing after JDK-8231111
  • Type: Bug
  • Component: core-libs
  • Affected Version: 15
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • Submitted: 2020-02-27
  • Updated: 2024-06-04
  • Resolved: 2020-03-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 15 JDK 8 Other
11.0.16Fixed 15 b14Fixed 8u371Fixed openjdk8u372Fixed
Related Reports
Relates :  
Relates :  
Description
On some Linux architectures, certain cgroupv1 features are not available. After the refactoring of the Metrics interface test updates were missed to account for certain cgroup files not being present.

Failures observed by SAP in their testing were:

Unable to open : /sys/fs/cgroup/memory/memory.kmem.failcnt
java.lang.RuntimeException: Test failed for - memory:memory.kmem.failcnt, expected [-1], got [0]
         at jdk.test.lib.containers.cgroup.CgroupMetricsTester.fail(CgroupMetricsTester.java:70)
         at jdk.test.lib.containers.cgroup.MetricsTesterCgroupV1.fail(MetricsTesterCgroupV1.java:187)
         at jdk.test.lib.containers.cgroup.MetricsTesterCgroupV1.testMemorySubsystem(MetricsTesterCgroupV1.java:239)
         at jdk.test.lib.containers.cgroup.MetricsTester.testAll(MetricsTester.java:61)
         at TestCgroupMetrics.main(TestCgroupMetrics.java:46)
         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.base/java.lang.reflect.Method.invoke(Method.java:564)
         at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
         at java.base/java.lang.Thread.run(Thread.java:832)

Unable to open : /sys/fs/cgroup/memory/system.slice/ssh.service/memory.memsw.failcnt
java.lang.RuntimeException: Test failed for - memory:memory.memsw.failcnt, expected [-1], got [0]
         at jdk.test.lib.containers.cgroup.CgroupMetricsTester.fail(CgroupMetricsTester.java:70)
         at jdk.test.lib.containers.cgroup.MetricsTesterCgroupV1.fail(MetricsTesterCgroupV1.java:187)
         at jdk.test.lib.containers.cgroup.MetricsTesterCgroupV1.testMemorySubsystem(MetricsTesterCgroupV1.java:291)
         at jdk.test.lib.containers.cgroup.MetricsTester.testAll(MetricsTester.java:61)
         at TestCgroupMetrics.main(TestCgroupMetrics.java:46)
         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.base/java.lang.reflect.Method.invoke(Method.java:564)
         at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
         at java.base/java.lang.Thread.run(Thread.java:832)

Unable to open : /sys/fs/cgroup/memory/memory.memsw.failcnt
java.lang.RuntimeException: Test failed for - memory:memory.memsw.failcnt, expected [-1], got [0]
         at jdk.test.lib.containers.cgroup.CgroupMetricsTester.fail(CgroupMetricsTester.java:70)
         at jdk.test.lib.containers.cgroup.MetricsTesterCgroupV1.fail(MetricsTesterCgroupV1.java:187)
         at jdk.test.lib.containers.cgroup.MetricsTesterCgroupV1.testMemorySubsystem(MetricsTesterCgroupV1.java:291)
         at jdk.test.lib.containers.cgroup.MetricsTester.testAll(MetricsTester.java:61)
         at TestCgroupMetrics.main(TestCgroupMetrics.java:46)
         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.base/java.lang.reflect.Method.invoke(Method.java:564)
         at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
         at java.base/java.lang.Thread.run(Thread.java:832)
 
JavaTest Message: Test threw exception: java.lang.RuntimeException: Test failed for - memory:memory.memsw.failcnt, expected [-1], got [0]
JavaTest Message: shutting down test
 
STATUS:Failed.`main' threw exception: java.lang.RuntimeException: Test failed for - memory:memory.memsw.failcnt, expected [-1], got [0]
Comments
Fix request (8u) Please approve this backport for JDK 8u as part of cgroups v2 support. It wasn't a clean cherry-pick: context problems needed manual review. Thanks
13-12-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk8u-dev/pull/124 Date: 2022-09-26 10:15:27 +0000
26-09-2022

Fix Request (OpenJDK 11u): Please approve backporting this test-only change to JDK 11u. It's a follow-up for JDK-8231111 which has been backported and fixes issues in container tests when run on some specific test systems. The original JDK 15 patch doesn't apply cleanly because of JDK-8275713 (partial backport of this for JDK < 15; which has been backported earlier) and JDK-8250984 which went into JDK 11u earlier than this. Resolved trivially. Risk is low as it's a test only change. Patch got reviewed by Martin Doerr. Tested this with container tests on Linux (cgroups v1 and v2). All pass. This is part of the cgroups v2 support work.
28-03-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk11u-dev/pull/956 Date: 2022-03-28 15:39:51 +0000
28-03-2022

URL: https://hg.openjdk.java.net/jdk/jdk/rev/1c40993361d0 User: sgehwolf Date: 2020-03-06 15:45:01 +0000
06-03-2020

These issues are caused by some hard coded values in tests which changed (from 0 for unavailable to -1) and for array types to now return null over a zero-length array for unavailable. RFR: http://mail.openjdk.java.net/pipermail/core-libs-dev/2020-February/065000.html
27-02-2020