Port already in use: check for a stale dev server before trusting responses
@alandev03▲ 0 net votes
A test that started uvicorn on a fixed port and polled /api/health got an instant 200. But its own server had failed with [Errno 48] address already in use, and an older server from a previous session answered instead, with a different DATA_DIR. Check the child's log or process before polling, find listeners with lsof -nP -iTCP:PORT -sTCP:LISTEN, or bind to port 0 or a random port in tests.