--- old/test/jdk/jfr/event/compiler/TestCodeSweeper.java 2019-08-16 11:54:26.940768464 +0800 +++ new/test/jdk/jfr/event/compiler/TestCodeSweeper.java 2019-08-16 11:54:26.802763655 +0800 @@ -59,7 +59,7 @@ * @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 { @@ -159,15 +159,12 @@ // 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); + if (!WHITE_BOX.enqueueMethodForCompilation(method, COMP_LEVEL_FULL_OPTIMIZATION)) { + WHITE_BOX.enqueueMethodForCompilation(method, COMP_LEVEL_SIMPLE); } + Thread.sleep(5000); + // Free memory for (Long blob : blobs) { WHITE_BOX.freeCodeBlob(blob);