8205928: [TESTBUG] jdk/internal/platform/docker/TestDockerMemoryMetrics
authorbobv
Tue, 03 Jul 2018 10:59:18 -0400
changeset 50972 51e49f77f7eb
parent 50968 14708e1acdc3
child 50973 833a291460b7
8205928: [TESTBUG] jdk/internal/platform/docker/TestDockerMemoryMetrics Reviewed-by: stuefe
test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java
--- a/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java	Tue Jul 03 09:27:41 2018 +0800
+++ b/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java	Tue Jul 03 10:59:18 2018 -0400
@@ -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!!!");
     }