< prev index next >

test/jdk/jfr/event/compiler/TestCodeSweeper.java

Print this page
rev 13658 : 8229401: Fix JFR code cache test failures

@@ -57,11 +57,11 @@
  *
  * @library /lib /
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:-SegmentedCodeCache -XX:+WhiteBoxAPI jdk.jfr.event.compiler.TestCodeSweeper
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI jdk.jfr.event.compiler.TestCodeSweeper
  */
 
 public class TestCodeSweeper {
     private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
     private static final int COMP_LEVEL_SIMPLE = 1;

@@ -157,18 +157,15 @@
             blobs.add(addr);
         }
 
         // Trigger the vm/code_cache/full event by compiling one more
         // method. This also triggers the vm/compiler/failure event.
-        Asserts.assertTrue(WHITE_BOX.addCompilerDirective(directive) == 1);
-        try {
             if (!WHITE_BOX.enqueueMethodForCompilation(method, COMP_LEVEL_FULL_OPTIMIZATION)) {
                 WHITE_BOX.enqueueMethodForCompilation(method, COMP_LEVEL_SIMPLE);
             }
-        } finally {
-            WHITE_BOX.removeCompilerDirective(1);
-        }
+
+        Thread.sleep(5000);
 
         // Free memory
         for (Long blob : blobs) {
             WHITE_BOX.freeCodeBlob(blob);
         }
< prev index next >