fix(e2e): wait for local wheel server to be ready before proceeding#925
Conversation
The start_local_wheel_server function launches python3 http.server in the background but returns immediately. On macOS CI runners the server can take a moment to start listening, causing uv to fail with TCP connect timeouts. Add a readiness poll loop that waits up to 15 seconds for the server to respond before returning. Closes: python-wheel-build#924 Co-Authored-By: Claude <claude@anthropic.com> Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
dfa7771 to
e06f12f
Compare
On macOS, python3 -m http.server without --bind calls getaddrinfo() which returns AF_INET6 first, causing the server to bind to :: (IPv6). Since macOS defaults IPV6_V6ONLY=1, the IPv6 socket does not accept IPv4 connections, so uv connecting to 127.0.0.1 gets ETIMEDOUT. Bind explicitly to 127.0.0.1 on macOS and 0.0.0.0 on Linux (where podman containers need to reach the server via the host's routable IP). Also replaces non-POSIX `which` with `command -v`. Closes: python-wheel-build#924 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
d3d1da4 to
2fb493c
Compare
|
Question: Why are we using an external wheel server in tests? I have rewritten the builtin wheel server a while ago. It is now a full features HTTP server with asyncio, Starlette and uvicorn instead of the naive threaded |
Some of the tests need a separate server to exercise the option that we use downstream to point to an external cache server. |
Why are we not using |
Because the person who added that feature didn't rewrite the tests? :-) |
Replace python3 -m http.server with the builtin fromager wheel-server (Starlette/uvicorn) and bind to 127.0.0.1 on all platforms. This is safe because uv pip install always runs on the host without network isolation. Eliminates platform-specific workarounds from PRs python-wheel-build#923/python-wheel-build#925. Closes: python-wheel-build#927 Co-Authored-By: Claude <claude@anthropic.com> Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
Replace python3 -m http.server with the builtin fromager wheel-server (Starlette/uvicorn) and bind to 127.0.0.1 on all platforms. This is safe because uv pip install always runs on the host without network isolation. Eliminates platform-specific workarounds from PRs python-wheel-build#923/python-wheel-build#925. Closes: python-wheel-build#927 Co-Authored-By: Claude <claude@anthropic.com> Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
On macOS, python3 -m http.server without --bind calls getaddrinfo() which returns AF_INET6 first, causing the server to bind to :: (IPv6). Since macOS defaults IPV6_V6ONLY=1, the IPv6 socket does not accept
IPv4 connections, so uv connecting to 127.0.0.1 gets ETIMEDOUT.
Also the start_local_wheel_server function launches python3 http.server in the background but returns immediately. On macOS CI runners the server can take a moment to start listening, causing uv to fail with TCP connect timeouts. Add a readiness poll loop that waits up to 15 seconds for the server to respond before returning.
Closes: #924