RFR: JDK-8328303: 3 JDI tests timed out with UT enabled [v2]

Serguei Spitsyn sspitsyn at openjdk.org
Fri Mar 22 20:42:27 UTC 2024


On Fri, 22 Mar 2024 19:26:33 GMT, Alex Menkov <amenkov at openjdk.org> wrote:

>> The change fixes 3 nsk JDI tests.
>> Root cause in all 3 tests is the same - the tests requests JDI event with SUSPEND_ALL policy, but event handler thread stops handle incoming event and this causes debuggee to hang (suspended by JDI event).
>> 
>> All 3 tests are updated to exit event handler thread after getting VMDeathEvent or VMDisconnectEvent (and resume debuggee after any other events).
>> ClassPrepareEvent tests need to wait some time to allow handle all expected events before terminate the debuggee. The logic was implemented by using CountDownLatch.
>> 
>> All tests are passed with "--test-repeat 20"
>
> Alex Menkov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   feedback

This looks good. I've posted a couple of nits/questions though.

One more question. Why these tests are failed with the UT enabled? Or maybe this was wrong assumption?

test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareEvent/referenceType/refType001.java line 134:

> 132:                         while (eventIterator.hasNext()) {
> 133:                             Event event = eventIterator.nextEvent();
> 134: //                            log.display("\nEvent received:\n  " + event);

Nit: Would it make sense to uncomment this log message? How many events are normally printed?

test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareEvent/referenceType/refType001.java line 277:

> 275:                 if (!eventsReceivedLatch.await(eventTimeout, TimeUnit.MILLISECONDS)) {
> 276:                     log.complain("FAILURE 20: Timeout waiting for all events was exceeded");
> 277:                     testFailed = true;

As I understand the call to `eventHandler.interrupt()` is not needed now because now the `eventHandler` is expected to finish by itself when one of the events is received: `VMDeathEvent` or `VMDisconnectEvent`.

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

Marked as reviewed by sspitsyn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/18442#pullrequestreview-1955749418
PR Comment: https://git.openjdk.org/jdk/pull/18442#issuecomment-2015874028
PR Review Comment: https://git.openjdk.org/jdk/pull/18442#discussion_r1536186503
PR Review Comment: https://git.openjdk.org/jdk/pull/18442#discussion_r1536184572


More information about the serviceability-dev mailing list