-
-
Notifications
You must be signed in to change notification settings - Fork 597
Synchronous testing of asynchronous server #638
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
Comments
I'm not sure if this is exactly what you need, but replacing your The |
Thank you @miguelgrinberg, works great! I managed to remove all sleeps instead of one - the one between I found few people had this problem but couldn't find another solution that Have you any advice in that case too? |
The sleep between connect and the first emit is not easy to remove. This is something that I hope to address in a future release. There is a discussion of this issue here: #634. |
I see. Thank you for information, I am looking forward and wait for this issue addressed. In case I could help you somehow with gathering information/contribute, let me knnow. |
Hi!
I have an FastApi application which uses
sio = socketio.AsyncServer(async_mode="asgi")
I am trying to test it with socketio client. I found solution here and tried to adapt it into my case (where my setup often needs to create many clients that emits many signals before I can test real case).
I ended with tons of
await asyncio.sleep(some_value)
in many places because of race conditions.Could someone help me and share some hints how can I test my application synchronously? The best would be to not use pytest-asyncio at all and process next emit only after previous one completes.
The text was updated successfully, but these errors were encountered: