RFR: JDK-8326389: [test] improve assertEquals failure output [v4]

Jaikiran Pai jpai at openjdk.org
Tue Feb 27 16:52:44 UTC 2024


On Tue, 27 Feb 2024 16:48:05 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

>> Currently assertEquals has in the failure case sometimes confusing output like :
>> 
>> java.lang.RuntimeException: VM output should contain exactly one RTM locking statistics entry for method compiler.rtm.locking.TestRTMTotalCountIncrRate$Test:🔒 expected 0 to equal 1
>>        at jdk.test.lib.Asserts.fail(Asserts.java:634)
>>        at jdk.test.lib.Asserts.assertEquals(Asserts.java:205)
>> 
>> (I don't think we really expected that for some reason 0 equals 1)
>> This should be improved.
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   adjust ms

Thank you Matthias. This looks good to me. I haven't checked references for this internal `Asserts` class. Before integrating, please run relevant tests that use this class just to be sure no test relies (and now fails) on the message being printed by the failing assertion.

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

Marked as reviewed by jpai (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/17952#pullrequestreview-1904154276


More information about the core-libs-dev mailing list