diff --git a/test/jdk/jdk/jfr/jcmd/TestJcmdDumpPathToGCRootsBFSDFS.java b/test/jdk/jdk/jfr/jcmd/TestJcmdDumpPathToGCRootsBFSDFS.java index 441aee60725..afd24a3ee9c 100644 --- a/test/jdk/jdk/jfr/jcmd/TestJcmdDumpPathToGCRootsBFSDFS.java +++ b/test/jdk/jdk/jfr/jcmd/TestJcmdDumpPathToGCRootsBFSDFS.java @@ -154,14 +154,13 @@ public class TestJcmdDumpPathToGCRootsBFSDFS { System.out.println("No events found in recording. Retrying."); continue; } - int foundChains = numChainsFoundInEvents(events); - final int minChainsRequired = 30; // very conservative, should be in the low 100s normally - if (expectedChains && foundChains < minChainsRequired) { + boolean chains = hasChains(events); + if (expectedChains && !chains) { System.out.println(events); - System.out.println("Expected chains but found not enough (" + foundChains + "). Retrying."); + System.out.println("Expected chains but found none. Retrying."); continue; } - if (!expectedChains && foundChains > 0) { + if (!expectedChains && chains) { System.out.println(events); System.out.println("Didn't expect chains but found some. Retrying."); continue; @@ -176,7 +175,7 @@ public class TestJcmdDumpPathToGCRootsBFSDFS { System.gc(); } - private static int numChainsFoundInEvents(List events) throws IOException { + private static boolean hasChains(List events) throws IOException { int found = 0; for (RecordedEvent e : events) { RecordedObject ro = e.getValue("object"); @@ -185,7 +184,8 @@ public class TestJcmdDumpPathToGCRootsBFSDFS { } } - return found; + System.out.println("Found chains: " + found); + return found > 0; } private static void buildLeak(int objectCount) { diff --git a/test/jdk/jdk/jfr/jvm/TestWaste.java b/test/jdk/jdk/jfr/jvm/TestWaste.java index ad97c2e604f..4de14fc2461 100644 --- a/test/jdk/jdk/jfr/jvm/TestWaste.java +++ b/test/jdk/jdk/jfr/jvm/TestWaste.java @@ -47,7 +47,7 @@ import jdk.jfr.Configuration; * @requires vm.hasJFR * @library /test/lib /test/jdk * @modules jdk.jfr/jdk.jfr.internal.test - * @run main/othervm -Xmx256m -Xlog:jfr+system+parser=debug -XX:TLABSize=2k jdk.jfr.jvm.TestWaste + * @run main/othervm -Xlog:jfr+system+parser=debug -XX:TLABSize=2k jdk.jfr.jvm.TestWaste */ public class TestWaste { static List list = new LinkedList<>(); @@ -55,7 +55,6 @@ public class TestWaste { public static void main(String... args) throws Exception { WhiteBox.setWriteAllObjectSamples(true); - WhiteBox.setSkipBFS(true); Configuration c = Configuration.getConfiguration("profile"); Path file = Path.of("recording.jfr"); Path scrubbed = Path.of("scrubbed.jfr");