Skip to content

Commit e06f12f

Browse files
fix(e2e): wait for local wheel server to be ready before proceeding
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 Co-Authored-By: Claude <claude@anthropic.com> Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
1 parent 8a093fc commit e06f12f

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

e2e/common.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,21 @@ start_local_wheel_server() {
8080
IP=127.0.0.1
8181
fi
8282
export WHEEL_SERVER_URL="http://${IP}:9999/simple"
83+
84+
# Wait for the server to accept connections (up to 15 s).
85+
{ set +x; } 2>/dev/null
86+
local ready=false
87+
for _ in $(seq 1 30); do
88+
kill -0 "$HTTP_SERVER_PID" 2>/dev/null || break
89+
curl -sf "http://${IP}:9999/" >/dev/null 2>&1 && { ready=true; break; }
90+
sleep 0.5
91+
done
92+
set -x
93+
94+
if $ready; then
95+
echo "Wheel server is ready"
96+
return 0
97+
fi
98+
echo "ERROR: wheel server did not become ready" >&2
99+
return 1
83100
}

0 commit comments

Comments
 (0)