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

Martin Buchholz martinrb at google.com
Fri May 1 19:55:09 UTC 2015


On Thu, Apr 30, 2015 at 11:27 AM, Jaroslav Bachorik <
jaroslav.bachorik at oracle.com> wrote:

> On 30.4.2015 19:18, Martin Buchholz wrote:
>
>> Tests that sleep can almost always be better written some other way.
>> In this case, I would prefer busy-waiting with timeout until the
>> expected condition becomes true.
>>
>
> The thing is that in case of a real issue with the thread counters we
> a/ would be busy-waiting till the test times out (using an arbitrary delay
> is also problematic due to different performance of different machines
> running with different configurations)
>

Far less problematic (performance-wise and reliability-wise) than the fixed
sleep.


> b/ would get a rather confusing message about the test timing out at the
> end


You can easily improve the error message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20150501/c3cea7fc/attachment.html>


More information about the serviceability-dev mailing list