Repository navigation
gh-162616: Clear asyncio's iscoroutine_typecaches between refleak tests - #162617
Conversation
…leak tests Creating a task checks if the argument is a coroutine. For non-native coroutines, this adds the type (the test's `Wrapper`) to `_asyncio`'s `iscoroutine_typecache`. Another check adds it to `asyncio.coroutines._iscoroutine_typecache`. Both caches are capped at 100 entries, so refleak tests report a reference leak unless you run 100+ warmup runs. Clear both caches in `libregrtest.utils.clear_caches`.
|
Sorry, @encukou and @asvetlov, I could not cleanly backport this to Please backport manually with cherry_picker, see the devguide for more information. |
|
Sorry, @encukou and @asvetlov, I could not cleanly backport this to Please backport manually with cherry_picker, see the devguide for more information. |
|
GH-162682 is a backport of this pull request to the 3.15 branch. |
|
GH-162683 is a backport of this pull request to the 3.14 branch. |
…fleak tests (GH-162617) (#162682) * gh-162616: Clear asyncio's `iscoroutine_typecache`s between refleak tests Creating a task checks if the argument is a coroutine. For non-native coroutines, this adds the type (the test's `Wrapper`) to `_asyncio`'s `iscoroutine_typecache`. Another check adds it to `asyncio.coroutines._iscoroutine_typecache`. Both caches are capped at 100 entries, so refleak tests report a reference leak unless you run 100+ warmup runs. Clear both caches in `libregrtest.utils.clear_caches`. * Apply suggestions from code review --------- (cherry picked from commit 233b95c) Co-authored-by: Petr Viktorin <encukou@gmail.com>
…fleak tests (GH-162617) (#162683) * gh-162616: Clear asyncio's `iscoroutine_typecache`s between refleak tests Creating a task checks if the argument is a coroutine. For non-native coroutines, this adds the type (the test's `Wrapper`) to `_asyncio`'s `iscoroutine_typecache`. Another check adds it to `asyncio.coroutines._iscoroutine_typecache`. Both caches are capped at 100 entries, so refleak tests report a reference leak unless you run 100+ warmup runs. Clear both caches in `libregrtest.utils.clear_caches`. * Apply suggestions from code review --------- (cherry picked from commit 233b95c) Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
|
Creating a task checks if the argument is a coroutine. For non-native coroutines, this adds the type (the test's
Wrapper) to_asyncio'siscoroutine_typecache.Another check adds it to
asyncio.coroutines._iscoroutine_typecache. Both caches are capped at 100 entries, so refleak tests report a reference leak unless you run 100+ warmup runs.Clear both caches in
libregrtest.utils.clear_caches.test_external_inspection.test_running_task_with_non_native_coroutine#162616