7144200: java/lang/management/ClassLoadingMXBean/LoadCounts.java failed with JFR enabled
authorjbachorik
Thu, 31 Oct 2013 11:59:09 +0100
changeset 21423 6f6edad5b031
parent 21422 6fca66995a27
child 21424 47236f604347
7144200: java/lang/management/ClassLoadingMXBean/LoadCounts.java failed with JFR enabled Summary: Make the test less stringent by not requiring the number of loaded classes to increase by a specific number Reviewed-by: sla
jdk/test/ProblemList.txt
jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java
--- a/jdk/test/ProblemList.txt	Thu Oct 31 11:59:04 2013 +0100
+++ b/jdk/test/ProblemList.txt	Thu Oct 31 11:59:09 2013 +0100
@@ -312,9 +312,6 @@
 # 8007410
 tools/launcher/FXLauncherTest.java                              linux-all
 
-# 7144200
-java/lang/management/ClassLoadingMXBean/LoadCounts.java		generic-all
-
 ############################################################################
 
 # jdk_jdi
--- a/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java	Thu Oct 31 11:59:04 2013 +0100
+++ b/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java	Thu Oct 31 11:59:09 2013 +0100
@@ -28,10 +28,10 @@
  *                             ClassLoadingMXBean.getTotalLoadedClassCount()
  *                             ClassLoadingMXBean.getUnloadedClassCount()
  * @author  Alexei Guibadoulline
+ * @run main/othervm LoadCounts
  */
 
 import java.lang.management.*;
-import java.util.*;
 
 public class LoadCounts {
     private static ClassLoadingMXBean mbean
@@ -55,13 +55,15 @@
             throw new RuntimeException("getLoadedClassCount() > "
                                      + "getTotalLoadedClassCount()");
 
-        if (classesNowPrev + 4 != classesNow)
+        if (classesNowPrev + 4 > classesNow)
             throw new RuntimeException("Number of loaded classes is "
+                                     + "expected to be at least "
                                      + (classesNowPrev + 4) + ", but "
                                      + "MBean.getLoadedClassCount() returned "
                                      + classesNow);
-        if (classesTotalPrev + 4 != classesTotal)
+        if (classesTotalPrev + 4 > classesTotal)
             throw new RuntimeException("Total number of loaded classes is "
+                                     + "expected to be at least "
                                      + (classesTotalPrev + 4) + ", but "
                                      + "MBean.getTotalLoadedClassCount() "
                                      + "returned " + classesTotal);
@@ -95,13 +97,15 @@
 
         // Expected 2 classes got loaded since they are loaded by
         // same defining class loader
-        if (classesNowPrev + 2 != classesNow)
-            throw new RuntimeException("Expected Number of loaded classes is "
+        if (classesNowPrev + 2 > classesNow)
+            throw new RuntimeException("Number of loaded classes is "
+                                     + "expected to be at least "
                                      + (classesNowPrev + 4) + ", but "
                                      + "MBean.getLoadedClassCount() returned "
                                      + classesNow);
-        if (classesTotalPrev + 2 != classesTotal)
+        if (classesTotalPrev + 2 > classesTotal)
             throw new RuntimeException("Total number of loaded classes is "
+                                     + "expected to be at least "
                                      + (classesTotalPrev + 4) + ", but "
                                      + "MBean.getTotalLoadedClassCount() "
                                      + "returned " + classesTotal);