Skip to content

Running test_asyncio prints several tracebacks when succeeding#96911

@gvanrossum

Description

@gvanrossum

This is a bit distracting. If someone knows where these come from, let's come up with a patch to silence these.

Details
$ ./python.exe -m test test_asyncio 0:00:00 load avg: 1.44 Run tests sequentially 0:00:00 load avg: 1.44 [1/1] test_asyncio Exception in callback interrupt_self() at /Users/guido/cpython/Lib/test/test_asyncio/test_runners.py:19 handle: <TimerHandle when=50711.269859326 interrupt_self() at /Users/guido/cpython/Lib/test/test_asyncio/test_runners.py:19> Traceback (most recent call last): File "/Users/guido/cpython/Lib/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/guido/cpython/Lib/test/test_asyncio/test_runners.py", line 20, in interrupt_self _thread.interrupt_main() ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/guido/cpython/Lib/asyncio/runners.py", line 146, in _on_sigint self._loop.call_soon_threadsafe(lambda: None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/guido/cpython/Lib/asyncio/base_events.py", line 809, in call_soon_threadsafe self._write_to_self() ^^^^^^^^^^^^^^^^^^^^^ File "/Users/guido/cpython/Lib/asyncio/base_events.py", line 511, in _write_to_self raise NotImplementedError ^^^^^^^^^^^^^^^^^^^^^^^^^ NotImplementedError Task exception was never retrieved future: <Task finished name='Task-1679' coro=<RunnerTests.test_interrupt_cancelled_task.<locals>.subtask() done, defined at /Users/guido/cpython/Lib/test/test_asyncio/test_runners.py:367> exception=NotImplementedError()> Traceback (most recent call last): File "/Users/guido/cpython/Lib/test/test_asyncio/test_runners.py", line 370, in subtask interrupt_self() ^^^^^^^^^^^^^^^^ File "/Users/guido/cpython/Lib/test/test_asyncio/test_runners.py", line 20, in interrupt_self _thread.interrupt_main() ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/guido/cpython/Lib/asyncio/runners.py", line 146, in _on_sigint self._loop.call_soon_threadsafe(lambda: None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/guido/cpython/Lib/asyncio/base_events.py", line 809, in call_soon_threadsafe self._write_to_self() ^^^^^^^^^^^^^^^^^^^^^ File "/Users/guido/cpython/Lib/asyncio/base_events.py", line 511, in _write_to_self raise NotImplementedError ^^^^^^^^^^^^^^^^^^^^^^^^^ NotImplementedError Exception in callback interrupt_self() at /Users/guido/cpython/Lib/test/test_asyncio/test_runners.py:19 handle: <TimerHandle when=50711.372428525996 interrupt_self() at /Users/guido/cpython/Lib/test/test_asyncio/test_runners.py:19> Traceback (most recent call last): File "/Users/guido/cpython/Lib/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/guido/cpython/Lib/test/test_asyncio/test_runners.py", line 20, in interrupt_self _thread.interrupt_main() ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/guido/cpython/Lib/asyncio/runners.py", line 146, in _on_sigint self._loop.call_soon_threadsafe(lambda: None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/guido/cpython/Lib/asyncio/base_events.py", line 809, in call_soon_threadsafe self._write_to_self() ^^^^^^^^^^^^^^^^^^^^^ File "/Users/guido/cpython/Lib/asyncio/base_events.py", line 511, in _write_to_self raise NotImplementedError ^^^^^^^^^^^^^^^^^^^^^^^^^ NotImplementedError test_asyncio passed in 55.0 sec == Tests result: SUCCESS == 1 test OK. Total duration: 55.0 sec Tests result: SUCCESS $ 

Tested on macOS. Does not happen in 3.11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixestopic-asynciotype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions