Skip to content

Commit c3c6662

Browse files
committed
8259954: gc/shenandoah/mxbeans tests fail with -Xcomp
Reviewed-by: rkennke, zgu
1 parent 6ce0799 commit c3c6662

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

test/hotspot/jtreg/gc/shenandoah/mxbeans/TestChurnNotifications.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,12 @@ public void handleNotification(Notification n, Object o) {
159159

160160
System.gc();
161161

162-
Thread.sleep(1000);
162+
// Wait until notifications start arriving, and then wait some more
163+
// to catch the ones arriving late.
164+
while (churnBytes.get() == 0) {
165+
Thread.sleep(1000);
166+
}
167+
Thread.sleep(5000);
163168

164169
long actual = churnBytes.get();
165170

test/hotspot/jtreg/gc/shenandoah/mxbeans/TestPauseNotifications.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,12 @@ public void handleNotification(Notification n, Object o) {
148148
sink = new int[size];
149149
}
150150

151-
Thread.sleep(1000);
151+
// Wait until notifications start arriving, and then wait some more
152+
// to catch the ones arriving late.
153+
while (pausesDuration.get() == 0) {
154+
Thread.sleep(1000);
155+
}
156+
Thread.sleep(5000);
152157

153158
long pausesActual = pausesDuration.get();
154159
long cyclesActual = cyclesDuration.get();

0 commit comments

Comments
 (0)