JDK-8298030 : [TESTBUG] CgroupMetricsTester.testMemoryUsage() test is unreliable
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • Submitted: 2022-12-02
  • Updated: 2022-12-02
  • Resolved: 2022-12-02
Related Reports
Duplicate :  
Duplicate :  
Description
In the family of cgroup test there is "TestCgroupMetrics.java" which fail with some probability here and then.

The failures are more frequent on older JVMs (e.g. 8) where G1 is not a default GC yet. But the failure can be easily reproduced with G1 as well.

*How to reproduce*
Run TestCgroupMetrics.java, but modify it a bit. In method testAll() of class MetricsTestser, run "tester.testMemoryUsage();" in a loop:
```
-        tester.testMemoryUsage();
+        for (int i = 0; i < 1000; i++)
+        {
+            tester.testMemoryUsage();
+        }
```