test(realtime): verify recovery boundaries and replacement credentials (#3979)
Adds real WebSocket coverage for existing Realtime recovery behavior in synchronous and asynchronous clients. - Direct `recv`, no callback, caller abort, nonrecoverable close and clean close stop without another upgrade. - Repeated typed admission errors followed by 1011 consume the retry budget: two retries, three sockets. A successful upgrade alone does not reset it. - OpenAI and Azure refresh caller-provided credentials on the replacement and preserve the connection's path, query, headers and disabled compression. Azure bearer mode never also sends an API key. - Cancelling a pending async receive leaves the next event and the socket usable. Tests only; no source, signatures, defaults, dependencies or generated code changed. Uses the existing real server fixture and fake credentials. The new file applies independently of the in-flight queue fix (#3978). Verified 179/179 relevant WebSocket, redirects and send-queue checks on each of Pydantic 1 and 2; Ruff check/format and git diff pass. Trusted budget unchanged at 7746/10000.
M
Mark Stuart committed
78074d7561b3ca7ade35357fcad26f5531f024c8
Parent: a52805c
Committed by GitHub <noreply@github.com>
on 9/28/2026, 2:01:33 PM