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

Running test_asyncio prints several tracebacks when succeeding #96911

Closed
gvanrossum opened this issue Sep 18, 2022 · 4 comments
Closed

Running test_asyncio prints several tracebacks when succeeding #96911

gvanrossum opened this issue Sep 18, 2022 · 4 comments
Labels
3.12 bugs and security fixes topic-asyncio type-bug An unexpected behavior, bug, or error

Comments

@gvanrossum
Copy link
Member

gvanrossum commented Sep 18, 2022

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

$ ./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.

@gvanrossum gvanrossum added type-bug An unexpected behavior, bug, or error topic-asyncio 3.12 bugs and security fixes labels Sep 18, 2022
@kumaraditya303
Copy link
Contributor

IIRC I had already fixed this, have you tried the latest main ?

@gvanrossum
Copy link
Member Author

Oh, you're right. Was it GH-95899 or another PR?

@gvanrossum gvanrossum closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 2022
@kumaraditya303
Copy link
Contributor

It was this one #93854

@gvanrossum
Copy link
Member Author

Oh, I was working on an old PR (not my own).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes topic-asyncio type-bug An unexpected behavior, bug, or error
Projects
Status: Done
Development

No branches or pull requests

2 participants