RFR: 8262080: vmTestbase/nsk/jdi/Event/request/request001/TestDescription.java failed with "ERROR: new event is not ThreadStartEvent"

Chris Plummer cjplummer at openjdk.java.net
Wed Mar 10 23:41:08 UTC 2021


On Wed, 10 Mar 2021 23:12:47 GMT, Alex Menkov <amenkov at openjdk.org> wrote:

> The fix updates the test to skip ThreadStartEvent/ThreadDeathEvent from other threads

test/hotspot/jtreg/vmTestbase/nsk/share/jdi/JDIBase.java line 171:

> 169:     // Waiting for ThreadStart and ThreadDeath event we can get events from system threads,
> 170:     // so need to ensure we get the event from the desired thread.
> 171:     protected void waitThreadStart(String threadName) throws JDITestRuntimeException {

I think this API is misnamed. It's not just waiting for a ThreadStart for the specified thread. It's waiting for any event other than ThreadStart for some other thread or ThreadDeath for any thread. That's a bit of an odd combination, and certainly not obvious based on the method name and description.

test/hotspot/jtreg/vmTestbase/nsk/share/jdi/JDIBase.java line 185:

> 183:             }
> 184:             // log the event and wait for next one
> 185:             log2("Waiting for ThreadStartEvent, got " + event);

This message is misleading. It could in fact be a ThreadStart, but for some other thread other than the named thread. I think the code would be clearer if there was no fall-through case. Put this code in an else, but also include a different message as part of the else for the `if (evt.thread().name().equals(threadName))` section. Maybe say something like "...got ThreadStartEvent for wrong thread".

-------------

PR: https://git.openjdk.java.net/jdk/pull/2927


More information about the serviceability-dev mailing list