From 2f6298d00f6f738d4ad5935168c2bf7abc137109 Mon Sep 17 00:00:00 2001 From: Julio Quinteros Pro Date: Sun, 1 Mar 2026 17:45:49 -0300 Subject: [PATCH] Fix observatory tunnel flaky DNS and suppress PLR0915 in router The observatory test workflow failed because the "Verify tunnel connectivity" step used a single curl with no retries. Cloudflare quick tunnels need time for DNS propagation, and the first lookup can return NXDOMAIN (curl exit 6). Replace with a retry loop (10 attempts, 5s apart) matching the pattern already used in the health check step. Also add `# noqa: PLR0915` to `_completion_streaming_iterator` in router.py, matching the suppression already on its async twin. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/run_observatory_tests.yml | 15 +++++++++++++-- litellm/router.py | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run_observatory_tests.yml b/.github/workflows/run_observatory_tests.yml index 3500cf9ad3a..d343098ed32 100644 --- a/.github/workflows/run_observatory_tests.yml +++ b/.github/workflows/run_observatory_tests.yml @@ -104,8 +104,19 @@ jobs: - name: Verify tunnel connectivity run: | echo "Testing tunnel at ${{ env.TUNNEL_URL }}..." - curl -sf "${{ env.TUNNEL_URL }}/health/liveliness" - echo "Tunnel is working" + # Quick tunnels need time for DNS propagation; retry to avoid + # transient NXDOMAIN (curl exit code 6) on first attempt. + for i in $(seq 1 10); do + if curl -sf "${{ env.TUNNEL_URL }}/health/liveliness" > /dev/null 2>&1; then + echo "Tunnel is working (attempt $i)" + exit 0 + fi + echo "Attempt $i/10 - tunnel not routable yet, waiting 5s..." + sleep 5 + done + echo "Tunnel failed to become reachable after 50s" + cat /tmp/cloudflared.log + exit 1 - name: Trigger observatory test run id: trigger diff --git a/litellm/router.py b/litellm/router.py index 34408e38e40..f21718a34c3 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -1718,7 +1718,7 @@ class Router: return FallbackStreamWrapper(stream_with_fallbacks()) - def _completion_streaming_iterator( + def _completion_streaming_iterator( # noqa: PLR0915 self, model_response: CustomStreamWrapper, messages: List[Dict[str, str]],