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
Comments
Comment #3
mondrakeComment #4
mondrakeComment #5
mondrakeComment #6
smustgrave commentedThis would probably be useful information as more random test failures keep popping up.
Comment #7
mondrakeComment #10
longwaveCommitted 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.