< prev index next >

test/lib/jdk/test/lib/containers/cgroup/MetricsTester.java

Print this page
@  rev 55664 : 8227642: [TESTBUG] Make docker tests podman compatible
|  Reviewed-by: duke
~

@@ -529,20 +529,24 @@
         long newSysVal = metrics.getCpuSystemUsage();
         long newUserVal = metrics.getCpuUserUsage();
         long newUsage = metrics.getCpuUsage();
         long[] newPerCpu = metrics.getPerCpuUsage();
 
-        if (newSysVal <= startSysVal) {
+        // system/user CPU usage counters may be slowly increasing.
+        // allow for equal values for a pass
+        if (newSysVal < startSysVal) {
             fail(SubSystem.CPU, "getCpuSystemUsage", newSysVal, startSysVal);
         }
 
-        if (newUserVal <= startUserVal) {
+        // system/user CPU usage counters may be slowly increasing.
+        // allow for equal values for a pass
+        if (newUserVal < startUserVal) {
             fail(SubSystem.CPU, "getCpuUserUsage", newUserVal, startUserVal);
         }
 
         if (newUsage <= startUsage) {
-            fail(SubSystem.CPU, "getCpuUserUsage", newUsage, startUsage);
+            fail(SubSystem.CPU, "getCpuUsage", newUsage, startUsage);
         }
 
         boolean success = false;
         for (int i = 0; i < startPerCpu.length; i++) {
             if (newPerCpu[i] > startPerCpu[i]) {
< prev index next >