From c4a8cb23496cc6851ca71de2e2b15ec09f5cb742 Mon Sep 17 00:00:00 2001 From: Chris Plummer Date: Wed, 15 Jul 2026 17:46:57 +0000 Subject: [PATCH] 8387640: vmTestbase/nsk/jdi/EventRequestManager/threadStartRequests/thrstartreq001/TestDescription.java fails intermittently Reviewed-by: sspitsyn, lmesnik --- .../threadStartRequests/thrstartreq001.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/threadStartRequests/thrstartreq001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/threadStartRequests/thrstartreq001.java index 7866547177f..39dc949c233 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/threadStartRequests/thrstartreq001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/threadStartRequests/thrstartreq001.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -201,7 +201,7 @@ public class thrstartreq001 { public void run() { try { - do { + while (true) { EventSet eventSet = vm.eventQueue().remove(1000); if (eventSet != null) { // there is not a timeout EventIterator it = eventSet.eventIterator(); @@ -219,11 +219,15 @@ public class thrstartreq001 { log.display("EventListener: following JDI event occured: " + event.toString()); } - if (isConnected) { - eventSet.resume(); - } + eventSet.resume(); + // Even if isConnected has been set false, we need to continue consuming + // events until there are no more. So do a continue here rather than + // allowing continuing to be conditional on isConnected below. + continue; } - } while (isConnected); + if (!isConnected) + break; + } } catch (InterruptedException e) { tot_res = FAILED; log.complain("FAILURE in EventListener: caught unexpected "