8335124: com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java failed with CPU time out of expected range

Reviewed-by: cjplummer
Backport-of: 79a3554e1da604627b3a010dc269c1bd914c79d3
This commit is contained in:
Kevin Walls 2024-07-09 19:39:25 +00:00
parent ca37a482cc
commit 70ad622bc2

View File

@ -75,7 +75,6 @@ public class ThreadCpuTimeArray {
// threads block after doing some computation
waitUntilThreadBlocked();
long times[] = mbean.getThreadCpuTime(ids);
long userTimes[] = mbean.getThreadUserTime(ids);
@ -222,6 +221,8 @@ public class ThreadCpuTimeArray {
}
}
}
// Account for threads using CPU for a few millis after their WAITING state is visible:
goSleep(500);
}
public static void doit() {