Problem/Motivation

If a test class fails, run-tests.sh reports the time of execution as double the real time.

Example:

All tests will run.
Test run started:
  Saturday, September 20, 2025 - 12:43
Test summary
------------
  20.279s Drupal\KernelTests\KernelTestBaseTest                                    18 passed
  68.660s Drupal\KernelTests\Core\Test\PhpUnitApiFindAllClassFilesTest              3 passed, exit code 1

and in detailed report

---- Drupal\KernelTests\Core\Test\PhpUnitApiFindAllClassFilesTest ----
Status      Duration Info                                                                               
--------------------------------------------------------------------------------------------------------
Pass         14.465s testEquality                                                                    
Pass         15.689s testEquality with data set "Extension: system"                                  
Pass          1.831s testEquality with data set "Extension: system, directory"                       
Failure      36.676s *** Process execution output ***                                                
    PHPUnit 11.5.39 by Sebastian Bergmann and contributors.
    
    Runtime:       PHP 8.4.12
    Configuration: /builds/issue/drupal-3497124/core/phpunit.xml.dist
    
    ...                                                                 3 / 3 (100%)
    
    Time: 00:36.264, Memory: 266.28 MB
    
    Php Unit Api Find All Class Files (Drupal\KernelTests\Core\Test\PhpUnitApiFindAllClassFiles)
     ✔ Equality
     ✔ Equality with Extension:·system
     ✔ Equality with Extension:·system,·directory
    
    There were 3604 PHPUnit test runner deprecations:

The actual execution time is around 36 seconds and not 68 seconds.

Proposed resolution

Do not duplicate execution time in summary report, do not report execution time of the PHPUnit dump in detailed report, indicate execution time below 1 millisecond explicitly.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3547746

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mondrake created an issue. See original summary.

mondrake’s picture

Status: Active » Needs review
mondrake’s picture

Issue tags: +PHPUnit 11
mondrake’s picture

Issue tags: +run-tests.sh
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

This would probably be useful information as more random test failures keep popping up.

mondrake’s picture

Issue summary: View changes

  • longwave committed b857b099 on 11.3.x
    ci: #3547746 run-tests.sh reports x2 duration for failed tests
    
    By:...

  • longwave committed fc5e3375 on 11.x
    ci: #3547746 run-tests.sh reports x2 duration for failed tests
    
    By:...
longwave’s picture

Version: 11.x-dev » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed fc5e337574d to 11.x and b857b099e18 to 11.3.x. Thanks!

Doesn't seem worth backporting any further at this stage, but nice to fix going forward.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.