RFR 8078143: java/lang/management/ThreadMXBean/AllThreadIds.java fails intermittently

Martin Buchholz martinrb at google.com
Fri May 15 20:59:35 UTC 2015


You may submit, but:

---

the @test is _NOT_ a javadoc comment - /* is more standard.
http://openjdk.java.net/jtreg/tag-spec.html#EXAMPLES

-/*
+/**
  * @test
  * @bug     4530538
  * @summary Basic unit test of ThreadMXBean.getAllThreadIds()
@@ -32,9 +32,30 @@
  */



On Thu, May 14, 2015 at 3:11 AM, Jaroslav Bachorik <
jaroslav.bachorik at oracle.com> wrote:

> On 13.5.2015 21:14, Martin Buchholz wrote:
>
>>
>>
>> It's common for users to introduce parallelism in classloaders or
>> jar-loaders (we do this at google) which may cause arbitrary thread
>> fluctuations.  That makes this particular API rather difficult to test
>> robustly, especially if you are only testing against the spec.
>>
>
> Well, in such an environment this test makes absolutely no sense - there
> is nothing deterministic in the thread counters we could assert against.
>

Consider creating a private thread group just for the test and restricting
the count assertions to just threads in that thread group - that should be
reliable (even if other tests are running concurrently in the same VM).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20150515/e2f28da7/attachment.html>


More information about the serviceability-dev mailing list