--- a/test/jdk/jdk/jfr/event/gc/collection/TestG1ParallelPhases.java Thu Oct 17 20:27:44 2019 +0100
+++ b/test/jdk/jdk/jfr/event/gc/collection/TestG1ParallelPhases.java Thu Oct 17 20:53:35 2019 +0100
@@ -98,22 +98,32 @@
"CLDGRoots",
"JVMTIRoots",
"CMRefRoots",
- "WaitForStrongCLD",
- "WeakCLDRoots",
- "UpdateRS",
- "ScanHCC",
- "ScanRS",
+ "WaitForStrongRoots",
+ "MergeER",
+ "MergeHCC",
+ "MergeRS",
+ "MergeLB",
+ "ScanHR",
"CodeRoots",
"ObjCopy",
"Termination",
"StringDedupQueueFixup",
"StringDedupTableFixup",
"RedirtyCards",
- // "PreserveCMReferents",
"NonYoungFreeCSet",
"YoungFreeCSet"
);
+ // Some GC phases may or may not occur depending on environment. Filter them out
+ // since we can not reliably guarantee that they occur (or not).
+ Set<String> optPhases = of(
+ "OptScanHR",
+ "OptMergeRS",
+ "OptCodeRoots",
+ "OptObjCopy"
+ );
+ usedPhases.removeAll(optPhases);
+
assertTrue(usedPhases.equals(allPhases), "Compare events expected and received"
+ ", Not found phases: " + allPhases.stream().filter(p -> !usedPhases.contains(p)).collect(joining(", "))
+ ", Not expected phases: " + usedPhases.stream().filter(p -> !allPhases.contains(p)).collect(joining(", ")));