< prev index next >

test/compiler/codecache/jmx/ThresholdNotificationsTest.java

Print this page

        

@@ -52,15 +52,13 @@
     private volatile long counter;
     private final BlobType btype;
 
     public static void main(String[] args) {
         for (BlobType bt : BlobType.getAvailable()) {
-            if (CodeCacheUtils.isCodeHeapPredictable(bt)) {
                 new ThresholdNotificationsTest(bt).runTest();
             }
         }
-    }
 
     public ThresholdNotificationsTest(BlobType btype) {
         this.btype = btype;
         counter = 0L;
         CodeCacheUtils.disableCollectionUsageThresholds();

@@ -90,11 +88,13 @@
         for (int i = 0; i < iterationsCount; i++) {
             CodeCacheUtils.hitUsageThreshold(bean, btype);
         }
         Asserts.assertTrue(
                 Utils.waitForCondition(
-                        () -> counter == iterationsCount, WAIT_TIME),
+                        () -> (CodeCacheUtils.isCodeHeapPredictable(btype) ?
+                                (counter == iterationsCount) : (counter >= iterationsCount)),
+                        WAIT_TIME),
                 "Couldn't receive expected notifications count");
         try {
             ((NotificationEmitter) ManagementFactory.getMemoryMXBean()).
                     removeNotificationListener(this);
         } catch (ListenerNotFoundException ex) {
< prev index next >