You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The litestart test clients directly call the ASGI app instance. When calling stream endpoints like SSEs, they will always try to consume the whole stream. If the endpoint serves an infinite generator, the test client is stuck. This does not happen for the test client websocket implementation is because it "cheats" by not implementing the actual websocket protocol but using an internal queue to transport the messages.
The solution for this edge case is to run the app in a subprocess (e.g. via uvicorn) and then use an httpx client to connect to the web app.
Summary
Follow-up from https://github.com/orgs/litestar-org/discussions/3547
The litestart test clients directly call the ASGI app instance. When calling stream endpoints like SSEs, they will always try to consume the whole stream. If the endpoint serves an infinite generator, the test client is stuck. This does not happen for the test client websocket implementation is because it "cheats" by not implementing the actual websocket protocol but using an internal queue to transport the messages.
The solution for this edge case is to run the app in a subprocess (e.g. via uvicorn) and then use an httpx client to connect to the web app.
Basic Example
No response
Drawbacks and Impact
No response
Unresolved questions
No response
Note
While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.
Check out all issues funded or available for funding on our Polar.sh dashboard
The text was updated successfully, but these errors were encountered: