Skip to content

Commit 0f71378

Browse files
committed
8291456: com/sun/jdi/ClassUnloadEventTest.java failed with: Wrong number of class unload events: expected 10 got 4
Backport-of: c5e0464098f8f7cd9c568c7b1c3a06139453eaab
1 parent 98e7f53 commit 0f71378

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

test/jdk/com/sun/jdi/ClassUnloadEventTest.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,8 @@ private static void runDebuggee() {
117117
// Trigger class unloading
118118
ClassUnloadCommon.triggerUnloading();
119119

120-
// Do a short delay to make sure all ClassUnloadEvents have been sent
121-
// before VMDeathEvent is generated.
122-
try {
123-
Thread.sleep(5000);
124-
} catch (InterruptedException e) {
125-
}
126-
120+
// We rely on JVMTI to post all pending ObjectFree events at VM shutdown.
121+
// It will trigger the JDWP agent to synthesize expected ClassUnloadEvents events.
127122
System.out.println("Exiting debuggee");
128123
}
129124

0 commit comments

Comments
 (0)