JDK-8205928 : [TESTBUG]: jdk/internal/platform/docker/TestDockerMemoryMetrics.java fails depending on kernel config
  • Type: Bug
  • Component: core-svc
  • Affected Version: 11
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • Submitted: 2018-06-27
  • Updated: 2024-06-04
  • Resolved: 2018-07-03
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 12
11 b22Fixed 12Fixed
Related Reports
Relates :  
Description
The testKernelMemoryLimit test will fail on Linux systems that do not have the CONFIG_MEMCG_KMEM=y config option enabled.

The Container Metric tests are dependent on docker which allow us to assume a certain minimum Linux kernel configuration level.  However, the kernel memory resource limiting feature is not a hard requirement for docker.   This test will need to be updated to allow for running on kernels without this option.

Comments
URL: http://hg.openjdk.java.net/jdk/jdk11/rev/51e49f77f7eb User: bobv Date: 2018-07-03 19:09:50 +0000
03-07-2018

Here is a patch that has been confirmed to fix the issue reported: diff --git a/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java b/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java --- a/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java +++ b/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java @@ -95,10 +95,11 @@ private static void testKernelMemoryLimit(String value) { long limit = getMemoryValue(value); - if (limit != Metrics.systemMetrics().getKernelMemoryLimit()) { + long kmemlimit = Metrics.systemMetrics().getKernelMemoryLimit(); + if (kmemlimit != 0 && limit != kmemlimit) { throw new RuntimeException("Kernel Memory limit not equal, expected : [" + limit + "]" + ", got : [" - + Metrics.systemMetrics().getKernelMemoryLimit() + "]"); + + kmemlimit + "]"); } System.out.println("TEST PASSED!!!"); }
28-06-2018