Skip to content

test_contextlib_async logs "Task was destroyed but it is pending" messages #89369

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

Closed
vstinner opened this issue Sep 15, 2021 · 1 comment · Fixed by #93074
Closed

test_contextlib_async logs "Task was destroyed but it is pending" messages #89369

vstinner opened this issue Sep 15, 2021 · 1 comment · Fixed by #93074
Labels
3.11 only security fixes tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

BPO 45206
Nosy @vstinner

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2021-09-15.13:23:17.714>
labels = ['tests', '3.11']
title = 'test_contextlib_async logs "Task was destroyed but it is pending" messages'
updated_at = <Date 2021-09-15.13:23:17.714>
user = 'https://github.com/vstinner'

bugs.python.org fields:

activity = <Date 2021-09-15.13:23:17.714>
actor = 'vstinner'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Tests']
creation = <Date 2021-09-15.13:23:17.714>
creator = 'vstinner'
dependencies = []
files = []
hgrepos = []
issue_num = 45206
keywords = []
message_count = 1.0
messages = ['401834']
nosy_count = 1.0
nosy_names = ['vstinner']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue45206'
versions = ['Python 3.11']

@vstinner
Copy link
Member Author

3 tests of test_contextlib_async logs messages. I would prefer a quiet output.

test_contextmanager_trap_second_yield (test.test_contextlib_async.AsyncContextManagerTestCase) ...
Task was destroyed but it is pending!
task: <Task pending name='Task-12' coro=<<async_generator_athrow without __name__>()>>
ok

test_contextmanager_trap_yield_after_throw (test.test_contextlib_async.AsyncContextManagerTestCase) ...
Task was destroyed but it is pending!
task: <Task pending name='Task-14' coro=<<async_generator_athrow without __name__>()>>
ok

test_async_gen_propagates_generator_exit (test.test_contextlib_async.TestAbstractAsyncContextManager) ...
Task was destroyed but it is pending!
task: <Task pending name='Task-20' coro=<<async_generator_athrow without __name__>()>>
ok

Current output:
---

$ ./python -m test test_contextlib_async 
0:00:00 load avg: 12.33 Run tests sequentially
0:00:00 load avg: 12.33 [1/1] test_contextlib_async
Task was destroyed but it is pending!
task: <Task pending name='Task-12' coro=<<async_generator_athrow without __name__>()>>
Task was destroyed but it is pending!
task: <Task pending name='Task-14' coro=<<async_generator_athrow without __name__>()>>
Task was destroyed but it is pending!
task: <Task pending name='Task-20' coro=<<async_generator_athrow without __name__>()>>

== Tests result: SUCCESS ==

1 test OK.

Total duration: 837 ms
Tests result: SUCCESS
---

@vstinner vstinner added 3.11 only security fixes tests Tests in the Lib/test dir labels Sep 15, 2021
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 24, 2022
… test (pythonGH-93074)

Use asyncio.run().
(cherry picked from commit d2ef66a)

Co-authored-by: Kumar Aditya <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 24, 2022
… test (pythonGH-93074)

Use asyncio.run().
(cherry picked from commit d2ef66a)

Co-authored-by: Kumar Aditya <[email protected]>
miss-islington added a commit that referenced this issue May 24, 2022
…H-93074)

Use asyncio.run().
(cherry picked from commit d2ef66a)

Co-authored-by: Kumar Aditya <[email protected]>
miss-islington added a commit that referenced this issue May 24, 2022
…H-93074)

Use asyncio.run().
(cherry picked from commit d2ef66a)

Co-authored-by: Kumar Aditya <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant