Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8291456: com/sun/jdi/ClassUnloadEventTest.java failed with: Wrong num…
…ber of class unload events: expected 10 got 4

Backport-of: c5e0464098f8f7cd9c568c7b1c3a06139453eaab
  • Loading branch information
adinn committed Oct 28, 2022
1 parent 9732004 commit aa98d09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/hotspot/share/prims/jvmtiExport.cpp
Expand Up @@ -730,6 +730,8 @@ void JvmtiExport::post_vm_initialized() {
void JvmtiExport::post_vm_death() {
EVT_TRIG_TRACE(JVMTI_EVENT_VM_DEATH, ("Trg VM death event triggered" ));

JvmtiTagMap::flush_all_object_free_events();

JvmtiEnvIterator it;
for (JvmtiEnv* env = it.first(); env != NULL; env = it.next(env)) {
if (env->is_enabled(JVMTI_EVENT_VM_DEATH)) {
Expand Down
9 changes: 2 additions & 7 deletions test/jdk/com/sun/jdi/ClassUnloadEventTest.java
Expand Up @@ -117,13 +117,8 @@ private static void runDebuggee() {
// Trigger class unloading
ClassUnloadCommon.triggerUnloading();

// Do a short delay to make sure all ClassUnloadEvents have been sent
// before VMDeathEvent is generated.
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
}

// We rely on JVMTI to post all pending ObjectFree events at VM shutdown.
// It will trigger the JDWP agent to synthesize expected ClassUnloadEvents events.
System.out.println("Exiting debuggee");
}

Expand Down

1 comment on commit aa98d09

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.