From 4e8cbf884ab1eee9c3110712ab62edc706e948ba Mon Sep 17 00:00:00 2001 From: Chris Plummer Date: Thu, 27 Jun 2024 22:20:14 +0000 Subject: [PATCH] 8335134: Test com/sun/jdi/BreakpointOnClassPrepare.java timeout Reviewed-by: kevinw, coleenp --- test/jdk/com/sun/jdi/BreakpointOnClassPrepare.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/jdk/com/sun/jdi/BreakpointOnClassPrepare.java b/test/jdk/com/sun/jdi/BreakpointOnClassPrepare.java index f4f1427e39b..deffffc0fa8 100644 --- a/test/jdk/com/sun/jdi/BreakpointOnClassPrepare.java +++ b/test/jdk/com/sun/jdi/BreakpointOnClassPrepare.java @@ -104,7 +104,15 @@ public class BreakpointOnClassPrepare extends TestScaffold { public void breakpointReached(BreakpointEvent event) { bkptCount++; - System.out.println("Got BreakpointEvent: " + bkptCount + " for thread " + event.thread()); + String threadInfo; + try { + threadInfo = event.thread().toString(); + } catch (ObjectCollectedException e) { + // It's possible the Thread already terminated and was collected + // if the SUSPEND_NONE policy was used. + threadInfo = "(thread collected)"; + } + System.out.println("Got BreakpointEvent: " + bkptCount + " for thread " + threadInfo); } public void vmDisconnected(VMDisconnectEvent event) {