On Fri, 14 Apr 2023 13:27:37 GMT, Fredrik Bredberg <[email protected]> wrote:
> Added the missing java.lang.Thread.beforeSleep and java.lang.afterSleep to
> expectedSystemTrace.
> Tested on my local machine.
This change is not sufficient. You also have:
# ERROR: Length of the stack trace is 206, but expected to be not greater than
205
and if you look at the log:
Snapshot of thread: 0
0:
jdk.internal.event.ThreadSleepEvent.isEnabled(ThreadSleepEvent.java:-1)
1:
jdk.internal.event.ThreadSleepEvent.isTurnedOn(ThreadSleepEvent.java:39)
2: java.lang.Thread.beforeSleep(Thread.java:456)
so you need to increase the allowance on the expected depth by 2 and add the
two SleepEvent methods to the expected list.
I don't think you want to add `afterSleep` as that means the thread woke too
soon and we may need to adjust the sleep time. - so we would want that to fail.
Thanks.
P.S. The comment block at line 209 discussing the extra allowance on stack
depth needs updating - it was already inaccurate before these latest Thread
changes. Thanks.
-------------
Changes requested by dholmes (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/13476#pullrequestreview-1386295135
PR Comment: https://git.openjdk.org/jdk/pull/13476#issuecomment-1509474451