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

Alex Menkov amenkov at openjdk.java.net
Thu Mar 11 23:17:25 UTC 2021


On Thu, 11 Mar 2021 22:48:55 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> Alex Menkov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   used pattern matching for instanceof to simplify the code
>
> 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

> test/hotspot/jtreg/vmTestbase/nsk/share/jdi/JDIBase.java line 158:
> 
>> 156:     // When ThreadStartRequest and/or ThreadDeathRequest are enabled, we can get the events from system threads
>> 157:     // unexpected for tests.
>> 158:     // The method skips ThreadStartEvent/ThreadDeathEvent events for all threads except the expected one.
> 
> Can you clean up the line lengths so they are close to being even.

done

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

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


More information about the serviceability-dev mailing list