Repository navigation
Reduce repeated setup in expensive Rest tests - #10006
Merged
Merged
Conversation
7 of 8 tasks
hua7450
marked this pull request as ready for review
October 8, 2026 00:49
hua7450
added a commit
to hua7450/policyengine-us
that referenced
this pull request
Oct 8, 2026
8 tasks done
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.
Related to #9904.
What and why
The Rest tests repeat expensive setup for identical marginal-tax-rate scenarios and rebuild a baseline model already available to the federal-credit tests. Reuse copied, read-only results for each marginal-rate cap, and supply the existing module baseline to each independently constructed credit reform.
Local cost measurements
test_marginal_tax_rate_coverage.py/ heavy-btest_federal_credit_limit_order.py/ remainingCombined elapsed time fell from 252.8 to 172.4 seconds: 80.4 seconds saved (31.8%) for these two files. Memory was not uniformly lower: federal-credit peak RSS rose approximately 6.4% in this pair.
These are single before/after local measurements on macOS with Python 3.14.6, PolicyEngine Core 3.32.8, the frozen dependency lock, CI's itemization setting, and Hypothesis seed 20261007. Each file ran in a separate sequential process; timings include import, setup, and shutdown. Measurements used baseline
a451dd5737f; the model, dependency versions, and affected test baselines are unchanged in current mainc6a9b818350. Full Rest group memory and Linux CI savings remain unmeasured.Test plan
make formatandgit diff --checkpass on the latest main base, which includes Skip the pull request workflow for draft PRs #9993.changelog.d/.axiom: n/a: test setup refactor only; no policy changes.