On Thu, 13 Aug 2026 04:51:36 GMT, Shiv Shah <[email protected]> wrote:

>> SleepingThread in ThreadController had a hardcoded list of JDK method names 
>> for stack trace checking every Thread.sleep change (JFR events, virtual 
>> threads, etc) required updating this list. Replaced with a generic JDK frame 
>> filter (java.*/jdk.*/sun.*) that works at any stack position, matching the 
>> approach already used in strace001.java and SleepingThread.java. Also added 
>> overridable checkElement/stackTraceLength methods to BaseThread so only 
>> SleepingThread behavior changes.
>> 
>> 
>> 
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Shiv Shah has updated the pull request with a new target base due to a merge 
> or a rebase. The incremental webrev excludes the unrelated changes brought in 
> by the merge/rebase. The pull request contains three additional commits since 
> the last revision:
> 
>  - Require the Thread.sleep entry frame instead of accepting any JDK frame
>  - Merge branch 'master' into JDK-8340088-v2
>  - 8340088: Stack tracing tests of sleeping thread should be more resilient 
> to code changes

Reopening with the rework.the sleep tests now just require the 
java.lang.Thread.sleep entry frame and ignore everything above it. callers 
below still go through the existing expected methods. getThreadInfo without a 
depth returns no stack at all, those paths skip the frame check.

strace001 threads are running not sleeping, so there is no sleep frame to 
anchor on. There it finds the innermost frame of the test’s own code and 
ignores what sits above. The depth + 7 length guess became depth plus the 
expected list size. an empty snapshot now fails explicitly instead of passing 
accidentally

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

PR Comment: https://git.openjdk.org/jdk/pull/31357#issuecomment-5276177527

Reply via email to