Skip to content

🧪 Enable memory leak tests on Python 3.14#7330

Merged
agoscinski merged 2 commits into
aiidateam:mainfrom
agoscinski:fix/memory-leaks-test
Apr 22, 2026
Merged

🧪 Enable memory leak tests on Python 3.14#7330
agoscinski merged 2 commits into
aiidateam:mainfrom
agoscinski:fix/memory-leaks-test

Conversation

@agoscinski
Copy link
Copy Markdown
Collaborator

Remove the skip markers from the engine memory leak tests. These were added when pympler.muppy.get_objects caused the suite to hang on Python 3.12.

agoscinski added a commit to agoscinski/aiida-core that referenced this pull request Apr 21, 2026
Remove the skip markers from the engine memory leak tests.
These were added when `pympler.muppy.get_objects` caused the
suite to hang on Python 3.12.
@agoscinski agoscinski force-pushed the fix/memory-leaks-test branch from 183a073 to c8df94c Compare April 21, 2026 11:47
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.89%. Comparing base (5f9d3fd) to head (5c8aa5d).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7330      +/-   ##
==========================================
+ Coverage   79.30%   79.89%   +0.59%     
==========================================
  Files         568      568              
  Lines       43941    43984      +43     
==========================================
+ Hits        34845    35138     +293     
+ Misses       9096     8846     -250     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@agoscinski agoscinski requested a review from khsrali April 21, 2026 12:23
@agoscinski agoscinski marked this pull request as ready for review April 21, 2026 12:35
Copy link
Copy Markdown
Collaborator

@khsrali khsrali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting!
i'll just re-run to amke sure no flak

@khsrali
Copy link
Copy Markdown
Collaborator

khsrali commented Apr 21, 2026

Ah, I see! that's because 3.12 is not tested in CI (?)

@agoscinski
Copy link
Copy Markdown
Collaborator Author

I am actually not sure why this problem is now solved. If this is a py3.12 only issue and it does not appear in py3.14. The commit that added the skipif is c39b4fd . I checked now locally and the test runs through with py3.12.


alexgo@m2air ~/c/a/w/f/flaky-tests (fix/memory-leaks-test-v1)> pixi run -e tests-py312-env python -m pytest -vv -m presto --db-backend sqlite tests/engine/test_memory_leaks.py 
===================================== test session starts =====================================
platform darwin -- Python 3.12.13, pytest-7.4.4, pluggy-1.6.0 -- /Users/alexgo/code/aiida-core/worktree/fix/flaky-tests/.pixi/envs/tests-py312-env/bin/python
cachedir: .pytest_cache
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /Users/alexgo/code/aiida-core/worktree/fix/flaky-tests
configfile: pyproject.toml
plugins: asyncio-0.16.0, instafail-0.5.0, rerunfailures-12.0, cov-7.1.0, xdist-3.8.0, timeout-2.4.0, regressions-2.10.0, datadir-1.8.0, benchmark-4.0.0
timeout: 240.0s
timeout method: thread
timeout func_only: False
collected 3 items                                                                             

tests/engine/test_memory_leaks.py::test_leak_run_process PASSED                         [ 33%]
tests/engine/test_memory_leaks.py::test_leak_local_calcjob PASSED                       [ 66%]
tests/engine/test_memory_leaks.py::test_leak_ssh_calcjob PASSED                         [100%]

===================================== slowest 5 durations =====================================
24.39s call     tests/engine/test_memory_leaks.py::test_leak_ssh_calcjob
4.19s call     tests/engine/test_memory_leaks.py::test_leak_local_calcjob
1.46s setup    tests/engine/test_memory_leaks.py::test_leak_ssh_calcjob
0.83s setup    tests/engine/test_memory_leaks.py::test_leak_run_process
0.77s teardown tests/engine/test_memory_leaks.py::test_leak_ssh_calcjob
===================================== 3 passed in 35.40s ======================================

Adding full python version coverage in CI would be probably helpful but a bit overkill.

@agoscinski agoscinski requested a review from khsrali April 21, 2026 18:02
Copy link
Copy Markdown
Collaborator

@khsrali khsrali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for checking out this ,thoroughly, @agoscinski
I think in general it's very safe to merge this, in the end it's activating previously skipped tests 🥲
I've just triggered a CI re-run to make sure, this was not a flaky pass.
Please feel free to merge once all green.

@danielhollas
Copy link
Copy Markdown
Collaborator

You might want to trigger the test-install workflow which tests all python versions.

@agoscinski
Copy link
Copy Markdown
Collaborator Author

The ci-code error is a flaky test that was fixed in last merge #7326 So I rebase and it should be fixed

Remove the skip markers from the engine memory leak tests.
These were added when `pympler.muppy.get_objects` caused the
suite to hang on Python 3.12.
@agoscinski agoscinski force-pushed the fix/memory-leaks-test branch from c8df94c to 5c8aa5d Compare April 22, 2026 07:51
@agoscinski
Copy link
Copy Markdown
Collaborator Author

You might want to trigger the test-install workflow which tests all python versions.

So I needed to add workflow dispatch to manually trigger run the test-install CI. By touching the file the CI is automatically triggered.

@agoscinski agoscinski enabled auto-merge (rebase) April 22, 2026 07:58
@agoscinski agoscinski merged commit 27e9129 into aiidateam:main Apr 22, 2026
31 checks passed
agoscinski added a commit that referenced this pull request Apr 22, 2026
Remove the skip markers from the engine memory leak tests.
These were added when `pympler.muppy.get_objects` caused the
suite to hang on Python 3.12.
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.

3 participants