RFR: 8301767: Convert virtual thread tests to JUnit [v2]

Jaikiran Pai jpai at openjdk.org
Wed Feb 8 12:32:45 UTC 2023


On Wed, 8 Feb 2023 12:19:02 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> test/jdk/java/lang/Thread/virtual/HoldsLock.java line 131:
>> 
>>> 129:                 assertEquals(vthread.getClass().getName(), info.getLockInfo().getClassName());
>>> 130:                 assertTrue(info.getLockInfo().getIdentityHashCode() == System.identityHashCode(vthread));
>>> 131:                 assertTrue(info.getLockOwnerId() == vthreadId);
>> 
>> Previously, before the change to these lines, in case of failure, the `assertEquals` would have printed even the incorrect/unexpected value in the log file/exception. Now with the usage of `assertTrue`, that information is lost from the failures. Do you think, in the context of this test, it would be worth to continue using assertEquals and just switch the param order to match junit expectations.
>
> We will be coming back to this test in the future (part of it is disabled) so we can re-visit this test at that time.

That sounds fine to me.

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

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


More information about the core-libs-dev mailing list