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

Chris Plummer cjplummer at openjdk.java.net
Fri Mar 12 01:28:08 UTC 2021


On Thu, 11 Mar 2021 23:07:49 GMT, Alex Menkov <amenkov at openjdk.org> wrote:

>> test/hotspot/jtreg/vmTestbase/nsk/share/jdi/JDIBase.java line 178:
>> 
>>> 176:             } else {
>>> 177:                 // not ThreadStartEvent nor ThreadDeathEvent
>>> 178:                 gotDesiredEvent = true;
>> 
>> Do you think it would be better if you only set `gotDesiredEvent = true` if the event came in on the named thread? If the event came in on another thread, it seems it should be ignored. If it came in on the named thread, then it is probably an error since the test is expecting ThreadStart or ThreadDeath, so in that case return and let the caller complain.
>
> Not sure I got the idea.
> gotDesiredEvent is a flag to exit the cycle, so if the event is not ThreadStart/Death event, we set the flag, leave the cycle and return the event to the caller. In case of request001 test it's an error and the test will fail, but this is desired behaviour

The purpose is to ignore all events on other threads (not just ThreadStart and ThreadDeath) rather than let result in the test failing. However, I can see now that determining the thread of the event is not easy (lots of instanceOf checks of the event type and casts to the proper type), so probably this is not worth doing unless it proves necessary at some point.

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

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


More information about the serviceability-dev mailing list