RFR: 7903753: Report duration of testng test methods [v2]

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Jun 14 10:28:27 UTC 2024


On Fri, 14 Jun 2024 09:16:04 GMT, Christian Stein <cstein at openjdk.org> wrote:

>> Hello Christian, we want the equality check of the key to be based on identity (since I don't think we can rely on the `equals()` implementation of `ITestResult`). ConcurrentHashMap uses `equals()` check unlike `IdentityHashMap` which uses `==`.
>> 
>> In the case of junit, where you used a ConcurrentHashMap, i think it's fine since the tests in junit appear to have a `UniqueId` unlike here where I don't see that construct exposed in testng.
>
> Understood.
> 
> Meaning that in this case we rely on TestNG re-using the exact same object instances for `onTestStart()` and `report()` methods.

A possibility here would be to maybe use a record class for the concurrent hash map key which extracts the test class name, and the test name from ITestResult. Would that be unique enough?

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

PR Review Comment: https://git.openjdk.org/jtreg/pull/207#discussion_r1639621738


More information about the jtreg-dev mailing list