fix: backend unavailable test — use free port + ws.close(timeout=2s)
All checks were successful
Build and Deploy iLSP / test (push) Successful in 20s
Build and Deploy iLSP / build-and-deploy (push) Successful in 1m32s

- Use _free_port() instead of hardcoded 19999 (avoids CI port conflicts)
- Add timeout=2.0 to ws.close() so close handshake never blocks >2s
This commit is contained in:
Henrik Jess Nielsen
2026-05-10 15:16:55 +02:00
parent 404bd1418d
commit bf24b5677f
2 changed files with 4 additions and 2 deletions

View File

@@ -72,7 +72,7 @@ async def _ws_proxy(request: web.Request, host: str, port: int) -> web.WebSocket
)
except (OSError, asyncio.TimeoutError) as exc:
logger.error("Cannot connect to LSP on %s:%d%s", host, port, exc)
await ws.close(code=1011, message=b"LSP backend unavailable")
await ws.close(code=1011, message=b"LSP backend unavailable", timeout=2.0)
return ws
async def ws_to_tcp():