This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_capi: test_c_subclass_of_heap_ctype_with_del_modifying_dunder_class_only_decrefs_once() leaks
Type: Stage: resolved
Components: Tests Versions: Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: eelizondo, matrixise, miss-islington, vstinner
Priority: normal Keywords: patch

Created on 2019-09-13 09:15 by vstinner, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 16115 merged eelizondo, 2019-09-13 16:30
PR 16118 merged matrixise, 2019-09-13 16:49
Messages (9)
msg352249 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-09-13 09:15
vstinner@apu$ ./python -m test test_capi -R 3:3 -m test.test_capi.CAPITest.test_c_subclass_of_heap_ctype_with_del_modifying_dunder_class_only_decrefs_once
Run tests sequentially
0:00:00 load avg: 0.57 [1/1] test_capi
beginning 6 repetitions
123456
......
test_capi leaked [2, 2, 2] references, sum=6
test_capi failed

== Tests result: FAILURE ==

1 test failed:
    test_capi

Total duration: 153 ms
Tests result: FAILURE


Note: Can't we find a shorter test name please?
msg352343 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-09-13 15:11
The new test was added by:

commit ff023ed36ea260ab64be5895f1f1f087c798987a
Author: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
Date:   Wed Sep 11 05:17:13 2019 -0400

    bpo-37879: Suppress subtype_dealloc decref when base type is a C heap type (GH-15323)
msg352346 - (view) Author: Eddie Elizondo (eelizondo) * Date: 2019-09-13 15:51
On it.

Also, I thought that the PR build bots already ran refleak tests by default? Do you know why this it's not integrated to the PR flow?
msg352347 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-09-13 15:52
> Also, I thought that the PR build bots already ran refleak tests by default? Do you know why this it's not integrated to the PR flow?

Checking for refleak takes between 2 and 6 hours. We would like to keep our pre-commit CI fast enough (less than 30 minutes).
msg352350 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2019-09-13 15:54
Eddie,

For the next time, when you change something in the C part, you could run the tests with this command:

./python -m test test_capi -R 3:3
msg352354 - (view) Author: Eddie Elizondo (eelizondo) * Date: 2019-09-13 16:04
> Checking for refleak takes between 2 and 6 hours.

Ouch! Makes sense then.

We could potentially add a `pre-merge` job that only runs once the merge starts to get executed. Anyways, that's a conversation for another time :-)

---

Thanks Stephane I'm very aware of that, I just thought that the build bots did that automatically at PR time. I rather have those drive the signal and letting my slow machine run for hours! Anyways, I'll just have to slightly change my workflow now
msg352364 - (view) Author: miss-islington (miss-islington) Date: 2019-09-13 16:48
New changeset a67ac2f2d9550e5a36d28f9b6eeacf6575dda2d5 by Miss Islington (bot) (Eddie Elizondo) in branch 'master':
bpo-38150 Fix refleak in the finalizer of a _testcapimodule type (GH-16115)
https://github.com/python/cpython/commit/a67ac2f2d9550e5a36d28f9b6eeacf6575dda2d5
msg352371 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2019-09-13 17:10
New changeset 53ff2ca89feb90c1fbf2605321bcef35b457f16f by Stéphane Wirtel in branch '3.8':
[3.8] bpo-38150: Fix refleak in the finalizer of a _testcapimodule type (GH-16115) (GH-16118)
https://github.com/python/cpython/commit/53ff2ca89feb90c1fbf2605321bcef35b457f16f
msg352374 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2019-09-13 17:16
Thank you, I close this issue.
History
Date User Action Args
2022-04-11 14:59:20adminsetgithub: 82331
2019-09-13 17:16:28matrixisesetstatus: open -> closed
resolution: fixed
messages: + msg352374

stage: patch review -> resolved
2019-09-13 17:10:56matrixisesetnosy: + matrixise
messages: + msg352371
2019-09-13 16:49:20matrixisesetpull_requests: + pull_request15732
2019-09-13 16:48:07miss-islingtonsetnosy: + miss-islington
messages: + msg352364
2019-09-13 16:30:00eelizondosetkeywords: + patch
stage: patch review
pull_requests: + pull_request15730
2019-09-13 16:04:06eelizondosetnosy: - matrixise
messages: + msg352354
2019-09-13 15:54:07matrixisesetnosy: + matrixise
messages: + msg352350
2019-09-13 15:52:08vstinnersetmessages: + msg352347
2019-09-13 15:51:13eelizondosetnosy: + eelizondo
messages: + msg352346
2019-09-13 15:11:10vstinnersetmessages: + msg352343
2019-09-13 09:15:22vstinnercreate