Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leaks in test_capi #98017

Merged
merged 1 commit into from Oct 7, 2022
Merged

Fix memory leaks in test_capi #98017

merged 1 commit into from Oct 7, 2022

Conversation

carljm
Copy link
Contributor

@carljm carljm commented Oct 7, 2022

These memory leaks were recently introduced in #31787. Not sure if this fix qualifies as "trivial" or requires an issue also.

Before this fix, ./python -m test test_capi -R 3:3 reports a memory leak; after this fix it passes.

@kumaraditya303
Copy link
Contributor

kumaraditya303 commented Oct 7, 2022

@kumaraditya303 ➜ /workspaces/cpython (fixleak) $ ./python -m test test_capi -R 3:3
0:00:00 load avg: 0.98 Run tests sequentially
0:00:00 load avg: 0.98 [1/1] test_capi
beginning 6 repetitions
123456
......
test_capi passed in 38.6 sec

== Tests result: SUCCESS ==

1 test OK.

Total duration: 38.6 sec
Tests result: SUCCESS

@kumaraditya303
Copy link
Contributor

kumaraditya303 commented Oct 7, 2022

@vstinner: This PR fixes ref leak on main. Currently all refleak buildbots are failing. See https://buildbot.python.org/all/#/release_status

@JelleZijlstra JelleZijlstra merged commit be4099e into python:main Oct 7, 2022
12 checks passed
@vstinner
Copy link
Member

vstinner commented Oct 7, 2022

You may want to use test.support.catch_unraisable_exception context manager, but it only stores the latest unraisable exception.

@carljm
Copy link
Contributor Author

carljm commented Oct 7, 2022

Thanks @vstinner, included the switch to catch_unraisable_exception in #98055

@carljm carljm deleted the fixleak branch Oct 7, 2022
@vstinner
Copy link
Member

vstinner commented Oct 8, 2022

Thanks @vstinner, included the switch to catch_unraisable_exception in #98055

Thanks! I like the new test code.

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.

None yet

5 participants