On 15.5.2015 22:59, Martin Buchholz wrote:
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 @@
   */

Will do.




On Thu, May 14, 2015 at 3:11 AM, Jaroslav Bachorik
<jaroslav.bacho...@oracle.com <mailto:jaroslav.bacho...@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).

I don't know how would you want to make this work. The ThreadMXBean counters are global per VM. Per thread group statistics are not supported.

-JB-

Reply via email to