Skip to content

tools: restore descending test timing order with --time - #65603

Open
Uziniii wants to merge 1 commit into
nodejs:mainfrom
Uziniii:tools-test-time-slowest
Open

tools: restore descending test timing order with --time#65603
Uziniii wants to merge 1 commit into
nodejs:mainfrom
Uziniii:tools-test-time-slowest

Conversation

@Uziniii

@Uziniii Uziniii commented Aug 27, 2026

Copy link
Copy Markdown

The --time option displays only the first 20 entries after sorting test durations. The current ascending sort therefore reports the fastest tests.

Before 1fc4255221, CompareTime() sorted durations in descending order.
That commit replaced the comparator with an ascending key-based sort while modernizing the Python code.

Sort durations in descending order to restore the historical behavior and report the tests that contribute most to the suite's execution time.

This also matches the output documented in: #27007

The change was verified with:

$ python3 tools/test.py --mode=release --time -j1 -p dots \
    parallel/test-inspector-not-blocked-on-idle \
    parallel/test-http-methods
   1 (00:01.391) release test-inspector-not-blocked-on-idle
   2 (00:00.106) release test-http-methods

AI assistance was used to investigate the Git history and write this description as im not a native english. I reviewed and verified the change.

Signed-off-by: Uzini <43294422+Uziniii@users.noreply.github.com>
@nodejs-github-bot nodejs-github-bot added test Issues and PRs related to Node.js core tests and test infrastructure. tools Issues and PRs related to the tools directory. labels Aug 27, 2026
lpinca
lpinca previously approved these changes Aug 29, 2026
@lpinca

lpinca commented Aug 29, 2026

Copy link
Copy Markdown
Member

It seems that the original implementation was also sorting in ascending order

timed_tests.sort(lambda a, b: a.CompareTime(b))

@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.05%. Comparing base (65f518c) to head (9fcf6df).
⚠️ Report is 122 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65603      +/-   ##
==========================================
- Coverage   90.12%   90.05%   -0.07%     
==========================================
  Files         751      751              
  Lines      252638   254919    +2281     
  Branches    47551    48130     +579     
==========================================
+ Hits       227689   229579    +1890     
- Misses      16238    16520     +282     
- Partials     8711     8820     +109     

see 93 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Issues and PRs related to Node.js core tests and test infrastructure. tools Issues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants