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
Member

@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 ➜ /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

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

@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
Member Author

carljm commented Oct 7, 2022

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

@carljm carljm deleted the fixleak branch October 7, 2022 19:35
@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.

mpage pushed a commit to mpage/cpython that referenced this pull request Oct 11, 2022
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.

5 participants