Skip to content

Commit c56fb0b

Browse files
author
Thomas Schatzl
committed
8364503: gc/g1/TestCodeCacheUnloadDuringConcCycle.java fails because of race printing to stdout
Reviewed-by: ayang, dholmes
1 parent 487cc3c commit c56fb0b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/hotspot/jtreg/gc/g1/TestCodeCacheUnloadDuringConcCycle.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ private static void triggerCodeCacheGC() throws Exception {
147147
}
148148

149149
public static void main(String[] args) throws Exception {
150+
System.out.println("Running to breakpoint: " + args[0]);
150151
try {
151152
WB.concurrentGCAcquireControl();
152153
WB.concurrentGCRunTo(args[0]);
@@ -157,9 +158,12 @@ public static void main(String[] args) throws Exception {
157158

158159
WB.concurrentGCRunToIdle();
159160
} finally {
161+
// Make sure that the marker we use to find the expected log message is printed
162+
// before we release whitebox control, i.e. before the expected garbage collection
163+
// can start.
164+
System.out.println(TestCodeCacheUnloadDuringConcCycle.AFTER_FIRST_CYCLE_MARKER);
160165
WB.concurrentGCReleaseControl();
161166
}
162-
System.out.println(TestCodeCacheUnloadDuringConcCycle.AFTER_FIRST_CYCLE_MARKER);
163167
Thread.sleep(1000);
164168
triggerCodeCacheGC();
165169
}

0 commit comments

Comments
 (0)