Skip to content

Skip the module-release test once core stops leaking; fix a comment - #2117

Merged
MaxGhenis merged 2 commits into
mainfrom
test-module-release-followup
Oct 3, 2026
Merged

MaxGhenis merged 2 commits into
mainfrom
test-module-release-followup

Conversation

@MaxGhenis

Copy link
Copy Markdown
Collaborator

Follow-up to #2115: the two code nits from its independent review.

  • test_variable_module_release.py: CI installs the newest policyengine-core. Once a core release fixes the sys.modules leak (TaxBenefitSystem construction permanently leaks ~5,600 sys.modules entries (~55-60MB) per build — unreclaimable by gc policyengine-core#520), the precondition assert would fail every PE-UK PR until someone deleted the workaround. It now calls pytest.skip, with a message saying to remove release_dead_variable_modules and the test. With today's core the test still runs and passes. With the fix commented out it still fails, because that check comes after the precondition.
  • conftest.py: the comment said one test process grew to 15.7 GB. The measured figure was 15.8 GB of the runner's memory in use while the suite ran serially, and the comment now says that.

These are test-only changes with no package or dependency change, so there is no changelog fragment and no release.

axiom: n/a: test infrastructure only.

🤖 Generated with Claude Code

MaxGhenis and others added 2 commits October 3, 2026 09:11
CI installs the newest policyengine-core. If a core release fixes the
sys.modules leak (policyengine-core#520), the regression test's
precondition would fail on every PE-UK PR until someone removed the
workaround. It now skips with a note to remove
release_dead_variable_modules and the test.

Also correct the conftest comment: 15.8 GB was the CI runner's memory
in use while the suite ran serially, not one process's size.

Both from the review of #2115.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the review of this PR: skipping whenever no module carried the
system's id would also skip if core kept leaking but changed the name
format, and then the conftest pattern would silently release nothing.
The test now looks up the module core loaded a variable from: it skips
only if that module is gone from sys.modules, and otherwise asserts the
conftest pattern still recognises it.

release_dead_variable_modules now counts only modules it actually
removed, so the test's `released >= 1` fails when nothing is removed
(checked by disabling the removal).

The conftest comment now gives the serial run's memory as 99% of the
runner's, since free -m reports MiB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis merged commit 7668506 into main Oct 3, 2026
6 checks passed
@MaxGhenis

Copy link
Copy Markdown
Collaborator Author

Merged at the reviewed head a77930f with a merge commit, on these gates:

  • gh pr checks exited 0: Test passed in 22m48s on ubuntu-24.04-arm.
  • The PR was MERGEABLE, not a draft, and had no review requesting changes.
  • An independent Opus 5.5 review approved d49910c (Subfleet job 20261003-091118-pe-uk-2117-review). Its one P3 was that the skip would also fire if core renamed the modules it leaks; a77930f fixes that.
  • A delta review of a77930f (20261003-091938-pe-uk-2117-review-delta) returned APPROVE with no findings.

This is test-only, so there is no changelog fragment and no release.

@MaxGhenis
MaxGhenis deleted the test-module-release-followup branch October 3, 2026 18:28
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