Skip to content

tests: shard the ownership manifest-controls test 4 ways so Debug/ASan stop timing out (CR-196) - #445

Merged
luisleo526 merged 2 commits into
mainfrom
ci-ownership-shards
Oct 19, 2026
Merged

luisleo526 merged 2 commits into
mainfrom
ci-ownership-shards

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

CR-196. Engine main CI has been RED since 10-18 22:28 on one test: test_selected_window_ownership_manifest_controls (tests/ownership/test_manifest_checker.py, 31 cases, ~39 checker subprocess runs, pure Python) hit ctest's 180 s TIMEOUT on the loaded pool box in Verify (Debug) and Verify (sanitizers) (run 39172376128); it already took 126-132 s in Release there.

Fix: the SAME module is registered as 4 ctest rows test_selected_window_ownership_manifest_controls_shard_{1..4}of4 (--shard I/N, stable sorted-id shards). Same cases, same assertions, same fixtures, same checker, same TIMEOUT 180. A guard class (run in every shard) proves for N=1..8 that the shards are disjoint and cover every case. The sharded entry exits 1 unless testsRun == the number selected (an empty shard is refused); unsharded behaviour is byte-identical.

Proof:

  • Lab rj-20261019t111845-bbea2d on this head (tree 88ac483c2649), all 8 steps PASSED: preflight 52 stages; release 960/960; debug 941/941; sanitizers 932/932; kernel 374/374; docs; subset 54/54; parity 312/312.
  • MEASURED shard times (s): release 14.4/14.9/24.7/14.1; debug 20.0/20.9/36.0/18.3; sanitizers 23.2/23.9/43.0/19.9; kernel 14.7/15.6/25.7/12.9. Heaviest 43.0 s of 180 s = 4.2x headroom.
  • Box (Python 3.12.3): unsharded Ran 32; shards Ran 9/9/9/8 each printing 'ran N tests as selected'; bad --shard values exit 2.
  • Reads: read 1 found a P0 in the first commit (unittest.main ignored defaultTest, so every shard ran ZERO tests and passed); fixed in 3485af1. Read 2: APPROVE.
    Notes: the 10-18 00:01 macOS Verify (Debug) failure was unrelated: ctest 938/938, the failing stage was abi-prior-fetch, a transient 'RPC failed; curl 56 Connection reset' with no retry (to CR-195). ci_verify floors still met (release 653 rows vs floor 603; kernel 343 vs 306).

🤖 Generated with Claude Code

luisleo526 and others added 2 commits October 19, 2026 18:54
test_selected_window_ownership_manifest_controls took 126-132 s on the loaded
pool box (180 s budget) and hit the timeout in Debug and sanitizers (run
39172376128). The module is pure Python and ~39 checker subprocess runs; the
same loader-discovered cases now run as four CTest entries
test_selected_window_ownership_manifest_controls_shard_{1..4}of4, each with the
same 180 s TIMEOUT, so no timeout is raised and no assertion, fixture or the
checker changes.

tests/ownership/test_manifest_checker.py gains --shard I/N (sorted
ManifestCheckerTests ids at positions [I-1::N], plus a cheap partition guard
case run in every shard that proves, for N=1..8, the shards are disjoint and
cover every case); without --shard the module behaves as before (preflight
and scripts/test_private_fixture_reads.py run it unsharded). CMake, docs/ci.md,
tests/ownership/README.md, the ci_verify floor note and the CHANGELOG say so.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…il closed

The independent read of f539b76 found that unittest.main(module=None,
defaultTest=ids, argv=[prog]) ignores defaultTest and falls back to
discovery, so each CTest shard ran zero tests (exit 0 before Python 3.12,
exit 5 from 3.12). The ids now go into argv, where unittest loads them by
name, and the sharded entry point exits 1 unless the number of tests it ran
equals the number it selected (and all passed); an empty shard is refused.
The CMake headroom comment now uses the heaviest shard (15 of the 39
checker runs, an estimate, about 2.4x on sanitizers) instead of the
average, and the README states what a shard checks. Cases, assertions,
fixtures, the checker and the 180 s timeout are untouched.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@luisleo526
luisleo526 merged commit 375795a into main Oct 19, 2026
20 checks passed
luisleo526 added a commit that referenced this pull request Oct 19, 2026
…375795a) into the notes fix

Brings engine main (the #445 test sharding) and the merge commit made on the
pull request, and keeps the notes-only commit c4b0bd0 on top, so the branch
head is a fast-forward of the pull request head.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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.

1 participant