mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
7a50e3ab04
The WebSocket echo server tests connect immediately after seeing "Starting server on port:" in the device log, but URI handlers (/ws, /ws_partial, /auth) are registered asynchronously after the server starts, taking 40-660ms depending on config and CI load. This causes two failures: 1. WebSocket handshake returns 404 Not Found because the URI handler is not registered yet when the client connects. 2. WebSocket echo returns wrong data because the server is in a partially initialized state. Wait for "Returned from app_main()" before connecting, which guarantees all URI handlers are registered. Add connection retry with WebSocketBadStatusException handling to WsClient and to the partial frame test's raw websocket connection. Extract _wait_for_server_ready() helper to deduplicate the WiFi credential input and server readiness logic across all 3 tests.