Skip to content

Conversation

@cconlon
Copy link
Member

@cconlon cconlon commented Nov 11, 2025

This PR adds a common test class named TimedTestWatcher, with functionality to print the time in ms taken for each JUnit test to complete. This will help in identifying slow tests. New output is similar to:

    [junit] JCE WolfCryptMessageDigestSha Class
    [junit] 	   21.20 ms  testShaThreaded
    [junit] 	    0.94 ms  testShaSingleUpdate
    [junit] 	    0.10 ms  testShaClone
    [junit] 	    0.07 ms  testShaReset
    [junit] 	    0.04 ms  testShaSingleByteUpdate
    [junit] 	    0.09 ms  testShaInterop
    [junit] 	    0.04 ms  testShaGetDigestLength
    [junit] JCE WolfCryptMessageDigestSha224 Class
    [junit] 	    0.61 ms  testSha224SingleUpdate
    [junit] 	    0.17 ms  testSha224Interop
    [junit] 	    0.07 ms  testSha224SingleByteUpdate
    [junit] 	    0.07 ms  testSha224GetDigestLength
    [junit] 	    0.17 ms  testSha224Clone
    [junit] 	    0.06 ms  testSha224Reset
    [junit] 	    0.07 ms  testSha224OidAlias
    [junit] JCE WolfCryptMessageDigestSha256 Class
    [junit] 	    0.03 ms  testSha256GetDigestLength
    [junit] 	    0.06 ms  testUpdateWithOffsetEqualToArraySizeThrows
    [junit] 	    0.50 ms  testSha256Clone
    [junit] 	    0.15 ms  testSha256Reset
    [junit] 	    0.05 ms  testSha256SingleByteUpdate
    [junit] 	    0.06 ms  testUpdateWithInvalidOffsetThrows
    [junit] 	    0.07 ms  testSha256SingleUpdate
    [junit] 	    9.73 ms  testSha256Threaded
    [junit] 	    0.10 ms  testSha256Interop
    [junit] 	    0.11 ms  testSha256OidAlias
    [junit] 	    0.08 ms  testUpdateWithInvalidLengthThrows
...

@cconlon cconlon self-assigned this Nov 11, 2025
@cconlon cconlon requested a review from Copilot November 11, 2025 19:20
Copilot finished reviewing on behalf of cconlon November 11, 2025 19:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a reusable TimedTestWatcher class that records and displays the execution time for each JUnit test in milliseconds. The implementation replaces inline anonymous TestWatcher instances across all test classes with a centralized, timing-aware test watcher to help identify slow tests.

  • Adds new TimedTestWatcher utility class with timing functionality
  • Refactors 60+ test classes to use the centralized TimedTestWatcher
  • Preserves the @Rule(order = Integer.MIN_VALUE) annotation for proper execution order

Reviewed Changes

Copilot reviewed 61 out of 61 changed files in this pull request and generated 2 comments.

File Description
src/test/java/com/wolfssl/wolfcrypt/test/TimedTestWatcher.java New utility class that extends TestWatcher to track and display test execution time in milliseconds
Multiple test files (60+) Replaced inline anonymous TestWatcher instances with TimedTestWatcher.create() calls
src/test/java/com/wolfssl/provider/jce/test/WolfCryptPKIXCertPathValidatorTest.java Updated TestWatcher usage and reformatted commented-out code blocks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rlm2002 rlm2002 merged commit ce88449 into wolfSSL:master Nov 11, 2025
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants