Repository navigation
Run make test as CI's bounded batches instead of one process over the whole tree - #9752
Merged
Merged
Conversation
… tree make test ran the whole policy tree in one policyengine-core test process. A 1,500-file baseline run of that shape reached 118 GB on a 128 GB Mac on 2026-10-02. make test now runs the Python suites and every YAML suite CI runs (test-yaml), one batched subprocess at a time; a code-health test keeps the list in step with .github/workflows/pr.yaml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 2, 2026
Merged
Review r1 (P2): a -j in MAKEFLAGS or `make -j test` would start the YAML suites in parallel and recreate the memory blow-up this target exists to prevent. .NOTPARALLEL with no prerequisites serializes every target, the only form GNU make 3.81 on macOS supports; CI calls single targets and never passes -j. Checked: under make 3.81 a two-target .NOTPARALLEL Makefile runs a then b with -j2, and test_make_test_matches_ci.py passes. Review r1 (P3): CONTRIBUTING.md described core #569 and #570 as landed; both are open drafts, so say so and drop the reform-system count that depends on #569's draft default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Merged by the US + core hub on its merge gates. Audit:
|
MaxGhenis
added a commit
that referenced
this pull request
Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
make test, the documented way to run the full suite (CLAUDE.md, CONTRIBUTING.md), ran:That is every policy YAML file in one process. CI never runs that shape:
.github/workflows/pr.yamlsplits the YAML suites intopolicyengine_us/tests/test_batched.pysubprocesses, sized to stay under about 8 GB each on 16 GB runners.On 2026-10-02, three local processes of that shape ran in parallel, each over a third of
tests/policy/baseline(about 1,500 files and 10,000 cases). Two of them reached 118 GB and 111 GB on a 128 GB Mac before they were killed.One process with 457 baseline files (every tenth, 3,100 cases) on core 3.32.12 went from 1.4 GB to a 14.5 GB kill cap after 267 cases (17 minutes). Live simulations grew linearly: 50, 120, 320, 420 at cases 50, 100, 150, 250.
The causes are in policyengine-core's YAML runner and parameter nodes and are fixed in PolicyEngine/policyengine-core#569 and #570. This PR fixes the local entry point, so a full run is bounded on any core version.
Change
make testnow runs the Python suites as CI splits them (test-other-python-spm,test-other-python-rest,test-microsimulation,test-policy-contrib-python) and thentest-yaml.test-yamlis new. It runs every YAML suite inpr.yaml, as Make prerequisites in sequence, so at most one batch is resident at a time; partners runs two small batches at once, as in CI.make testno longer writescoverage.xml; CI's coverage comes from the Quick Feedback job, which this does not touch.test_make_test_matches_ci.py(code health) runsmake -nand fails if:test_batched.pycommand inpr.yamlis missing frommake test(a sharded CI command counts as covered by its unsharded form);make testrunspolicyengine-core testdirectly.Both checks fail on the old Makefile and pass on this one.
CLAUDE.md and CONTRIBUTING.md now give the safe local invocations:
make test-yaml-*target ortest_batched.py ... --workers 1;policyengine-core test;axiom: n/a: test tooling and docs only
Tests
pytest policyengine_us/tests/code_health/test_make_test_matches_ci.py: passes; both tests fail onmain's Makefile.make -n test: 37test_batched.pyinvocations and no directpolicyengine-core test.🤖 Generated with Claude Code