On Thu, 8 Jan 2026 01:07:45 GMT, Serguei Spitsyn <[email protected]> wrote:

> The test is still failing after the fix of 
> [JDK-8371502](https://bugs.openjdk.org/browse/JDK-8371502). I suspect the 
> issue is in the `ReentrantLock` implementation but suggest to make one more 
> update of this test to make it more clear.
> The test update includes the following changes:
>  - update method `ensureReadyAndWaiting()`:
>     - add `sleep(50)` at start of method
>     - replace call to `rlock.hasQueuedThreads()` with call to 
> `rlock.hasQueuedThread(vt)`
>  - update method `checkStates()` to make it more stable and tracing output 
> more clear
>  
>  Testing:
>   - TBD: mach5 tiers 1-3

Changes requested by lmesnik (Reviewer).

test/hotspot/jtreg/serviceability/jvmti/vthread/ThreadListStackTracesTest/ThreadListStackTracesTest.java
 line 48:

> 46: 
> 47:     public void ensureReadyAndWaiting(Thread vt, Thread.State expState, 
> ReentrantLock rlock) {
> 48:         sleep(50); // reliability: wait for a potential ReentrantLock 
> class loading to complete

It is not clear how ReentrantLock might be not loaded already.  Can you please 
explain what do you mean?

test/hotspot/jtreg/serviceability/jvmti/vthread/ThreadListStackTracesTest/ThreadListStackTracesTest.java
 line 134:

> 132:                           expState, state, jvmtiExpState, singleState, 
> multiState);
> 133: 
> 134:         if (state != expState) {

Assuming that there is no way to find if thread is completely locked, might be 
it makes a sense to just make a few attempts of checking status?
The test might sleep between attempts until got expected results. Even get them 
3 times in a row.
So test fails only if we can't get to expected results during some reasonable 
time. So test would be more stable. 
The only sleep between single check might be not enough in the case if VM/host 
is too busy.

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

PR Review: https://git.openjdk.org/jdk/pull/29102#pullrequestreview-3637592479
PR Review Comment: https://git.openjdk.org/jdk/pull/29102#discussion_r2670801028
PR Review Comment: https://git.openjdk.org/jdk/pull/29102#discussion_r2670831765

Reply via email to