changeset 59354:10cf1d393996

8229829: java/lang/management/ThreadMXBean/Locks.java fails with java.lang.RuntimeException: Thread WaitingThread is at WAITING state but is expected to be in Thread.State = WAITING Reviewed-by: sspitsyn, dholmes
author amenkov
date Tue, 19 May 2020 14:46:20 -0700
parents 88142d00ec1c
children 5e33db086599
files test/jdk/java/lang/management/ThreadMXBean/Locks.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/test/jdk/java/lang/management/ThreadMXBean/Locks.java	Tue May 19 21:04:44 2020 +0200
+++ b/test/jdk/java/lang/management/ThreadMXBean/Locks.java	Tue May 19 14:46:20 2020 -0700
@@ -91,7 +91,9 @@
         long tid = t.getId();
         Thread.State actualState = TM.getThreadInfo(tid).getThreadState();
         if (!actualState.equals(expectedState)) {
-            if (expectedState.equals(Thread.State.BLOCKED)) {
+            if (expectedState.equals(Thread.State.BLOCKED) ||
+                expectedState.equals(Thread.State.WAITING))
+            {
                 int retryCount = 0;
                 printStackTrace(t);
                 do {