Skip to content

test(runtime-sdk): report a failing WebSocket test instead of hanging - #238

Merged
ryanking13 merged 1 commit into
cloudflare:mainfrom
whitphx:test/asgi-ws-close-socket-on-failure
Sep 1, 2026
Merged

test(runtime-sdk): report a failing WebSocket test instead of hanging#238
ryanking13 merged 1 commit into
cloudflare:mainfrom
whitphx:test/asgi-ws-close-socket-on-failure

Conversation

@whitphx

@whitphx whitphx commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

The current impl of test_client_close_reaches_app_as_disconnect can hang when something fails before ws.close() as it leave the app awaiting receive() and the worker invocation never completed.
This PR fixes it by using the _ws_session() context to close the socket however the test ends.

test_client_close_reaches_app_as_disconnect opened its socket by hand, so
a failure before its ws.close() left the app awaiting receive() and the
worker invocation never completed, reaching the CI job limit instead of
reporting the assertion. Drive it through _ws_session, which closes the
socket however the test ends.

Injecting the same deliberate failure before the close, the run went
from timing out with no output to failing in 12s.
@ryanking13
ryanking13 merged commit 9f17a1e into cloudflare:main Sep 1, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants