Skip to content

TST: Isolate StringDType leak regression from xdist threads - #33412

Closed
hector2394 wants to merge 2 commits into
numpy:mainfrom
hector2394:fix/33409-memory-measurement
Closed

hector2394 wants to merge 2 commits into
numpy:mainfrom
hector2394:fix/33409-memory-measurement

Conversation

@hector2394

Copy link
Copy Markdown
Contributor

PR summary

Addresses #33409 by running the StringDType buffer-leak regression in a fresh Python subprocess. Its process-wide tracemalloc measurement can include allocations from pytest-xdist's communication threads. A local reproduction attributed the excess memory to execnet.

The existing allocation workload and 1,024-byte limit are preserved. The test uses run_subprocess so failures in the child reach pytest, and skips on platforms without subprocess support.

The StringDType module passed twice under ARM64 emulation with automatic worker selection. Ruff passed. Disabling reference cleanup in a disposable native build still caused the revised test to detect the leak. Patched native ARM64 CI remains pending.

AI Disclosure

Codex assisted with source inspection, CI-log analysis, diagnostic scripts, the subprocess-isolation change and automated validation. I reviewed the final diff.

@hector2394

Copy link
Copy Markdown
Contributor Author

Could someone please rerun the failed macOS ARM64 check? @ngoldbaum It failed in test_large_string_cast_memory_limit, which this PR doesn't change, and the same job passed on the previous head. All other checks passed. Thanks!

@ngoldbaum

Copy link
Copy Markdown
Member

Please don't work on newly filed issues in a project you don't regularly contribute to like this. Also please don't ping people like that on a Sunday. I've literally had zero working hours to consider the problem. The fact that another test is failing indicates that there is a wider problem that needs looking at, not just restarting the test.

@ngoldbaum

Copy link
Copy Markdown
Member

I'm closing this because it's not the correct solution for the problem.

@ngoldbaum ngoldbaum closed this Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants