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.

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

Commit messages:
 - disable ThreadCpuTimeArray with xcomp

Changes: https://git.openjdk.org/jdk/pull/17675/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17675&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8325137
  Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/17675.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17675/head:pull/17675

PR: https://git.openjdk.org/jdk/pull/17675

Reply via email to