Skip to content

Rerun the Gemini auth-recovery e2e case on a live gateway timeout - #1612

Merged
lilly-luo merged 2 commits into
mainfrom
lilly-luo/gemini-smoke-timeout-rerun
Nov 12, 2026
Merged

lilly-luo merged 2 commits into
mainfrom
lilly-luo/gemini-smoke-timeout-rerun

Conversation

@lilly-luo

Copy link
Copy Markdown
Collaborator

Summary

TestGeminiAuthRecovery::test_recovers_when_initial_token_empty flakes when the live Gemini model is slow. Its direct gateway call (_run_gemini_gateway_smoke) uses urlopen(timeout=30), and on a slow response that raises a bare TimeoutError: The read operation timed out. The e2e shards already rerun live timeouts once (#1245), but only failures matching timed out after [0-9]+s, so this case fails on the first attempt while the CLI launch tests next to it get their rerun.

This change converts a socket timeout (bare, or wrapped in URLError on connect) into AssertionError: Gemini gateway smoke for model=<m> timed out after 30s. That matches the existing --only-rerun pattern. HTTP errors and other URLErrors still fail immediately. Tests only; no product code.

Seen on both Gemini shards in https://github.com/databricks/unity-gateway/actions/runs/40733908631 (Oct 28) and again on Windows in run 43048607627 (Nov 11, after #1595).

Tests

  • ruff check / ruff format --check clean on tests/test_e2e.py.
  • Scratch pytest run with the CI flags (--reruns 1 --only-rerun 'timed out after [0-9]+s'), with urlopen patched to raise. A bare TimeoutError and a URLError(socket.timeout) each produce RERUN. A non-timeout URLError propagates unchanged.
  • Not run live.

This pull request and its description were written by Isaac.

Co-authored-by: Isaac <no-reply@databricks.com>
@lilly-luo
lilly-luo marked this pull request as ready for review November 12, 2026 03:54
@lilly-luo
lilly-luo requested a review from masonc08 November 12, 2026 03:56
@lilly-luo
lilly-luo added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit b53a11f Nov 12, 2026
65 checks passed
@lilly-luo
lilly-luo deleted the lilly-luo/gemini-smoke-timeout-rerun branch November 12, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants