Repository navigation
TST: fix flaky memory growth tests - #33417
Merged
Merged
Conversation
jorenham
reviewed
Nov 22, 2026
jorenham
left a comment
Member
There was a problem hiding this comment.
I left some superficial opinionated suggestions; hope you don't mind
Co-authored-by: Joren Hammudoglu <[email protected]>
ikrommyd
approved these changes
Nov 23, 2026
ikrommyd
left a comment
Member
There was a problem hiding this comment.
I think this is good. I'd honestly be fine with not having memory growth tests at all as well cause they are difficult to do in CI anyways but this is fine. Doing it on linux only like you do in the PR is enough, we only need one system to measure these things.
Member
Author
|
I think they're worth having. If they continue to cause issues I'll get rid of them though. |
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.
PR summary
Fixes #33409. Also see #33374, this revises what we ended up with there.
Move all tests that rely on tracemalloc to run in a subprocess, including the new memory growth assert helper added in #33241. Tracemalloc is process-wide, so pytest-xdist workers can interfere with the measurement this test does. I think that's what happened here: https://github.com/numpy/numpy-release/actions/runs/44977466535/job/137070536035
I also revised what we came up with in #33374 because of the failure seen here: https://github.com/numpy/numpy/actions/runs/45045409029/job/137278823294?pr=33412
The Darwin legacy malloc might be used if the SDK used to build Python is sufficiently old, as in the conda-forge test run above. There isn't a public API to determine which malloc implementation is used, so the only way to avoid flaky tests is to not run the RLIMIT_AS address space memory growth tests on MacOS.
AI Disclosure
I worked on this with an AI model.