Integrated: 8325137: com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java can fail in Xcomp with out of expected range
Doug Simon
dnsimon at openjdk.org
Fri Feb 2 10:47:05 UTC 2024
On Thu, 1 Feb 2024 18:25:33 GMT, Doug Simon <dnsimon at openjdk.org> wrote:
> The `com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java` can transiently fail when run with `-Xcomp`. This happens when the compilation of methods on the worker threads interleaves with the 2 calls on the main thread to `mbean.getThreadCpuTime` to get the CPU time for all worker threads.
>
> The way the test is currently written, the worker threads are all usually waiting on a shared monitor when the 2 timings are taken. That is, in a successful run, the delta between the timings is always 0. When `-Xcomp` compilations kick in at the "wrong" time or take sufficiently long, the expected delta of 100 nanoseconds is easily exceeded.
>
> It does not make sense to run a timing test with such a small expected delta with `-Xcomp` so this PR simply ignores the test when `-Xcomp` is present.
This pull request has now been integrated.
Changeset: 91d8dac9
Author: Doug Simon <dnsimon at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/91d8dac9cff5689abcf2fc8950b15d284f933afd
Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod
8325137: com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java can fail in Xcomp with out of expected range
Reviewed-by: dholmes, sspitsyn
-------------
PR: https://git.openjdk.org/jdk/pull/17675
More information about the serviceability-dev
mailing list