Repository navigation
Run the Python tests on six shards - #2690
Conversation
Python shards took 63 to 75 minutes against the 75-minute limit, which cancelled shard 4/5 of run 40308966462, and peaked at 15.5 to 15.9 GB of the 16 GB runners, losing shards in runs 40393666784 and 40395541241. A sixth shard spreads both: the duration-balanced slow tests come to about 134 minutes of worker time per shard instead of 161. The matrix gains a 6. Job names, outcome artifacts, Result and check_test_shards.py already follow the matrix size, so only the comments and docs that said five or K/5 change. Tests: test_ci_test_shards.py and test_ci_runner_variables.py pass (126); those 126 tests also pass run as --shard K/6 for K = 1..6, and check_test_shards.py accepts the six outcome logs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This PR's own run, 40422010249: all six shards and Result passed.
Against five shards: merge queue run 40406434741 took 66 to 69 minutes with peaks of 12,845 to 15,589 MB, and #2649's run 40308966462 took 63 to 75 minutes (4/5 cancelled at the limit). So time improves: the slowest shard is 64 minutes instead of 69 to 75, about 11 minutes under the limit. Memory does not improve the way I expected. Shard 3/6 peaked at 15,612 MB, as high as the worst five-shard shard, and four of six shards are still above 14 GB. The peak seems to come from particular tests on a worker rather than from how many tests each worker runs, so a sixth shard does not by itself fix the runner losses. That is one run, so treat it as a first reading. Max, this still needs your OK on the extra runner. A real memory fix probably needs a look at which tests drive the peak (#2330), separately from this PR. 🤖 Generated with Claude Code |
juaristi22
left a comment
There was a problem hiding this comment.
Program review
Base repository: PolicyEngine/policyengine-uk
PR number: 2690
Reviewed head SHA: e252830
Merge base SHA: 96315db
Mode: full
Scope: Changed CI six-shard behavior and affected static dependencies; no policy changes or performance audit
Source manifest: /private/tmp/policyengine-command-runs/881387a1b745/pr2690-external-review-20261027-review-sources.json
Review status: COMPLETE
Source Documents
No source documents registered; see scope and validation.
Critical
None.
Should Address
None.
Suggestions
None.
Evidence Gaps
No material gaps reported.
Notes
- CODE-only review: this is pure infrastructure, so policy/source review is inapplicable under the workflow. Static evidence traces strategy.job-total into K/6 selection, generic duration/hash partitioning, numbered artifact logs, and wildcard Result completeness/failure auditing. PR, main, queue and wheel callers use the same reusable workflow; Result/Lint names and data/publication gates are unchanged. See the detailed CODE report for file/line evidence.
- Max’s explicit extra-runner cost decision remains a maintainer landing choice. Live branch-protection settings, author-reported local test counts, historical durations/RSS, memory causes and universal memory relief were not independently certified. This code approval grants no merge, queue, cost or administrative authority.
- The original canonical start at 09:00:54.312239 UTC is retained. A long wall-clock gap before CODE analysis has unproved cause; the complete review exceeds its original 20/25-minute targets. No clock reset, excluded time or workflow timing PASS is claimed. The first CODE dispatch marker was not saved; no exact dispatch/scope60-second success claim is made.
Validation Summary
Exact e252830 capture has 36 raw checks:35SUCCESS and1PublishSKIPPED; all CheckSuite commits join to the reviewed head. Source run40422010249 and release-wheel run40422010259 passed YAML, all six Python shards and Result (source121941740975; release121941296302). This is hosted check-status evidence, not independently read logs/artifacts/test counts/private amounts/RSS. Local tests, collection, country/Core imports, model calculations, environment setup and formatting NOT RUN; no duplicate local run needed for this matrix-only static review. New external source GETs0/sourcebudget0. Detailed CODE evidence: /private/tmp/policyengine-command-runs/881387a1b745/pr2690-external-review-20261027-review-code.md Exact snapshot head/tree/index remained clean, then it was removed normally after CODE DONE; no forced cleanup. Receipt: /private/tmp/policyengine-command-runs/881387a1b745/pr2690-external-review-20261027-Root-normal-cleanup.json
Timing
setup seconds: 2991.97s; code role seconds: 312.43s; policy role seconds: 0.00s; adjudication seconds: 0.00s; consolidation cleanup seconds: 93.70s; elapsed seconds: 3458.29s
Review Severity
APPROVE. Open findings: 0 critical, 0 should address, 0 suggestions.
Why
The five Python shards are at both of their limits.
Time. Shards now take 57 to 75 minutes against a 75-minute
timeout-minutes.Memory. Peaks are 13 to 15.9 GB of the 16 GB runner.
#2637 deals the slow tests out by recorded duration, so a sixth shard spreads both time and memory. With
shard_durations.tomlas it stands, the listed slow tests come to about 161 minutes of worker time per shard on five shards and 134 on six; the hashed remainder also falls by a sixth per shard.What changed
.github/workflows/test-suite.yaml: the matrix isshard: [1, 2, 3, 4, 5, 6], and the comments say six andK/6. A new paragraph above the job records the numbers above.pr_code_changes.yaml,Makefile,docs/engineering/skills/testing.mdanddocs/book/validation/ubuntu-vs-macos.md: "five" andK/5become "six" andK/6.Nothing else needed editing. The job name and
--shardusestrategy.job-total, the outcome artifacts areoutcomes-K.jsonl, Result downloadstest-*and passesoutcomes-*.jsonl, andcheck_test_shards.pytakes the shard count from the logs it is given. Historical comments (the 5-shard measurements intest-suite.yaml,conftest.pyandshard_durations.toml) are left as records.Checks
The required checks keep their names: "Test / Result" and "Lint" (checked against the branch rules for
main). The per-shard checks become "Test / Python K/6"; none of them is required, so the merge queue is not affected.Run locally in a fresh
uv sync --frozen --extra devenvironment:test_ci_test_shards.pyandtest_ci_runner_variables.py: 126 passed.--shard K/6for K = 1 to 6 (22, 20, 24, 20, 18 and 22 tests), thencheck_test_shards.pyon the six outcome logs: every collected test ran in exactly one shard and passed.Not run locally: the full suite. This PR's own CI run is the test of the timings and memory; I will add the six shards' durations and peaks here when it finishes.
For Max to decide
🤖 Generated with Claude Code