RFR: 7903752: Include duration information in JUnit-based tests

Pavel Rappo prappo at openjdk.org
Thu Jun 13 09:57:26 UTC 2024


On Thu, 13 Jun 2024 09:37:42 GMT, Christian Stein <cstein at openjdk.org> wrote:

> Please review this change to include duration information in JUnit-based tests.
> 
> For example, see this excerpt from a `.jtr` file generated for the `JupiterTests` self-test.
> 
> Before:
> 
> #section:junit
> ...
> ----------System.err:(21/1306)----------
> STARTED    JupiterTests::nullEmptyAndBlankStrings '[1] test('null')'
> SUCCESSFUL JupiterTests::nullEmptyAndBlankStrings '[1] test('null')'
> STARTED    JupiterTests::nullEmptyAndBlankStrings '[2] test('')'
> SUCCESSFUL JupiterTests::nullEmptyAndBlankStrings '[2] test('')'
> ...
> 
> After:
> 
> #section:junit
> ...
> ----------System.err:(21/1306)----------
> STARTED    JupiterTests::nullEmptyAndBlankStrings '[1] test('null')'
> SUCCESSFUL JupiterTests::nullEmptyAndBlankStrings '[1] test('null')' [24ms]
> STARTED    JupiterTests::nullEmptyAndBlankStrings '[2] test('')'
> SUCCESSFUL JupiterTests::nullEmptyAndBlankStrings '[2] test('')' [1ms]
> ...

I'm not an official reviewer here, but thanks for doing this. And thanks for using `System.nanoTime()`. Because we didn't have this feature, I had to write something similar ad-hoc in https://github.com/openjdk/jdk/pull/19627.

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

PR Comment: https://git.openjdk.org/jtreg/pull/206#issuecomment-2165175462


More information about the jtreg-dev mailing list