test: stabilize websocket broadcast test - #31039
Conversation
|
Release-unblock context from triage: This PR now addresses two independent CI blockers seen across current release-candidate PRs:
Local verification after the second commit:
Note: GitHub currently reports no checks for this fork PR, so the local verification above is the available signal from this machine. |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for addressing both CI concerns. The contributor-attribution portion remains useful, but the websocket-test change should not be transplanted as written.
Problems
tests/hermes_cli/test_web_server.py:2329replaces the bounded receiver-thread wait withtime.sleep(0.05)followed by unboundedreceive_text(). A starved TestClient/ASGI thread can still miss that fixed delay and hang.- Current main already has a deterministic replacement at
tests/hermes_cli/test_web_server.py:6865-6920: it calls_broadcast_eventdirectly with fake subscribers and verifies both same-channel fan-out and channel isolation. The production fan-out is inhermes_cli/web_server.py:14788-14800.
Suggested changes
- Preserve the current-main websocket test; do not salvage this PR's test hunk.
- Salvage the attribution change separately. The CI workflow still only exempts numeric-plus noreply forms at
.github/workflows/contributor-check.yml:39-44, althoughscripts/release.py:2154-2162already resolves both noreply forms. Revalidate the three proposedAUTHOR_MAPidentities while applying that focused change.
Automated hermes-sweeper review.
| if isinstance(received, Exception): | ||
| raise received | ||
| # Give the server-side publisher coroutine a chance to fan | ||
| # out the frame before the publisher websocket is closed. |
There was a problem hiding this comment.
A fixed 50 ms sleep does not establish that the ASGI broadcast completed; sub.receive_text() remains unbounded if that thread is delayed. Current main avoids this scheduling race by testing _broadcast_event directly with fake subscribers, so this hunk should be dropped during salvage.
|
Thanks @josephnilo — closing as resolved on main: the websocket broadcast flake was fixed with a different approach (driving _broadcast_event directly with fake subscribers, no portal). This branch also carries unrelated workflow/release.py changes that would need their own PRs. |
Summary
Test Plan
Context: PR #30948's test slice failed on this flaky websocket broadcast test; this patch is independent of the curator change and intended to unblock release CI.