RFR: 8265153: add time based test for ThreadMXBean.getThreadInfo() and ThreadInfo.getLockOwnerName()

David Holmes david.holmes at oracle.com
Sun May 2 05:48:22 UTC 2021


On 1/05/2021 6:57 am, Daniel D.Daugherty wrote:
> On Wed, 28 Apr 2021 12:55:18 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> test/hotspot/jtreg/serviceability/monitoring/ThreadInfo/getLockOwnerName/getLockOwnerName.java line 137:
>>
>>> 135:         }
>>> 136:
>>> 137:         System.exit(run(timeMax, System.out) + exit_delta);
>>
>> jtreg tests don't use System.exit!
> 
> Hmmm... that's  generally true, but this is a test that must be run as
> "othervm" so this style of exit with the "+ exit_delta" logic has been
> used for these kinds of stress tests. I think this style came from the
> VMTestbase tests and I've used it with other stress tests.

Hmmm... this is a legacy style/approach that is not necessary any more. 
If the test fails it should throw an exception from the main thread and 
that will produce a non-zero exit value. I think seeing this legacy 
style in new tests will just confuse people.

YMMV.

Cheers,
David

> -------------
> 
> PR: https://git.openjdk.java.net/jdk/pull/3478
> 


More information about the serviceability-dev mailing list