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

Websockets implementation does not clean properly tasks if handshake fails #920

Closed
euri10 opened this issue Dec 28, 2020 · 0 comments · Fixed by #921
Closed

Websockets implementation does not clean properly tasks if handshake fails #920

euri10 opened this issue Dec 28, 2020 · 0 comments · Fixed by #921

Comments

@euri10
Copy link
Member

euri10 commented Dec 28, 2020

this is a good explanation of what we see in those 2 tests and that causes flaky tests:

FWIW there's an asyncio warning when I try to run test_send_before_handshake or test_missing_handshake in isolation. Doesn't show if I run either along with other tests, eg either the full test suite, with -k websocket, or the two tests together with -k "missing_handshake or before_handshake".

$ pytest -k test_missing_handshake
====================================================== test session starts =======================================================
platform darwin -- Python 3.9.0, pytest-6.1.1, py-1.9.0, pluggy-0.13.1
rootdir: /Users/florimond/Developer/python-projects/uvicorn, configfile: setup.cfg
plugins: mock-3.3.1, asyncio-0.14.0
collected 213 items / 211 deselected / 2 selected                                                                                

tests/protocols/test_websocket.py ..                                                                                       [100%]

=============================================== 2 passed, 211 deselected in 2.30s ================================================
Task was destroyed but it is pending!
task: <Task pending name='Task-11' coro=<WebSocketServerProtocol.handler() done, defined at /Users/florimond/Developer/python-projects/uvicorn/venv/lib/python3.9/site-packages/websockets/server.py:118> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x10a7e1760>()]>>

Originally posted by @florimondmanca in #918 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants