Skip to content

test(tools): run the rebase_verify tests in three ctest shards - #25461

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
einfachama:test/rebase-verify-shards
Nov 22, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
einfachama:test/rebase-verify-shards

Conversation

@einfachama

@einfachama einfachama commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What

rebase_verify is over the 30 s that CONTRIBUTING.md allows a test on every Windows run. The windows job of the Build workflow on main reports it at 48.2 to 49.8 s in each of its last four completed runs (44970429056, 44968344723, 44963555299, 44955500745), and the Windows MSYS2 nightly at 44.1 s (44884949723). Its TIMEOUT is 60.

Why: the script is git process start-ups. Counting subprocess.run calls in one run of the 42 tests on Windows: 610 calls to git, 39.1 ms each on average, 23.9 s of the 26.2 s run (91%). Each verify() runs about ten git commands, and most tests build their own commits first.

This PR splits the script into three ctest runs with the --shard INDEX/COUNT scheme conventions_function_bodies already uses: the cases are sorted by id and dealt round-robin. The first shard keeps the name rebase_verify; the others are rebase_verify_shard_1 and rebase_verify_shard_2, each with the existing TIMEOUT 60. A new TestShardTests checks that the shards run every case exactly once. No test is removed or changed. check_test_registration.py accepts the registration: a script run without class names counts as running all of its classes.

Tested

Windows 11 Pro 26H2 (10.0.26300), AMD Ryzen 7 5800X (8 cores, 16 threads), MSYS2 UCRT64 GCC 16.2.0, Python 3.12.10, Git 2.56.1.windows.1, Release, BUILD_TESTING=ON, non-elevated. main c94713f7c7 against this PR on top of it. Times are the ctest times of each run.

main (rebase_verify) this PR (rebase_verify / _shard_1 / _shard_2)
alone, 5 runs, serial 34.73, 34.78, 35.10, 34.88, 35.32 s 10.69–12.87 / 11.83–11.96 / 14.22–15.16 s
the three shards with -j3, 3 runs slowest shard 16.67–17.10 s, wall time 17.1–17.5 s
under 16 busy processes, 3 runs, serial 90.60, 95.03, 93.31 s 27.16–28.82 / 30.59–30.95 / 36.90–37.21 s
full ctest -j16 --timeout 120 87.10 s (run of 2026-11-21) 32.85 / 30.21 / 40.43 s

Alone, the three shards together take 2 to 3 s more than the single run (Python start-up and the shared fixture repository of RebaseVerifyTests, built once per shard). The Windows runners took 48 to 50 s for what takes 35 s alone here; at the same ratio the slowest shard would take about 21 s there. That is an estimate; the CI annotations of this PR's run will show it.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

rebase_verify took 48 to 50 s in every Windows job of the Build
workflow on main and 44 s in the Windows MSYS2 nightly, over the 30 s
that CONTRIBUTING.md allows a test. Almost all of it is git: the 42
tests start 610 git processes, about 39 ms each on Windows (23.9 s of
a 26.2 s run).

Split the script into three ctest runs with the --shard INDEX/COUNT
scheme of conventions_function_bodies. The first shard keeps the name
rebase_verify; TestShardTests checks that the shards run every case
exactly once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the build label Nov 22, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed — looks good

The reviewed change at head 4bb061a6c82e147cf1236e9bcc0849e090b1f43c distributes discovered test cases across three CTest invocations, and the inspected code supports the stated shard behavior.

What I ran

No commands were run. I inspected the prepared diff and the changed files at the pinned head.

Results

Check Result Note
Diff and changed code review passed Both changed files inspected
Automated checks not run Relied on review bundle’s author-reported results

Findings

Blocking

None.

Non-blocking

None.

Not verified

The full test suite, Windows runtime behavior, and reported benchmark results were not independently verified. files.json was not available through the reader, so I could not confirm the excluded-file inventory. The review manifest lists two changed files, both of which were read: CMakeLists.txt and tools/tests/test_rebase_verify.py.

To get this to a good state

Nothing is required.

@oneandonlydean
oneandonlydean merged commit 9bac175 into boykopovar:main Nov 22, 2026
14 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants