test(integration): address round-3 review — harden RAG fixture & retry naming

- indexed_manual_pdf fixture: also require status == "idle" (alongside the
  existing indexed > 0 and pending == 0) so it doesn't break during a transient
  pending==0 window mid re-scan churn. Keeps the indexed > 0 guard — a pure
  status==idle check would break prematurely on the initial empty state.
- _get_with_retry: rename `retries` -> `max_attempts` (3 total) and 1-index the
  loop so the param and "attempt N/M" log read self-evidently.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Chris Coutinho
2026-06-17 22:59:27 +02:00
co-authored by Claude Opus 4.8
parent 909f36613d
commit 367afa0402
2 changed files with 12 additions and 6 deletions
@@ -44,17 +44,17 @@ _SEARCH_TIMEOUT = httpx.Timeout(90.0)
async def _get_with_retry(
client: httpx.AsyncClient, url: str, *, retries: int = 2, **kwargs
client: httpx.AsyncClient, url: str, *, max_attempts: int = 3, **kwargs
) -> httpx.Response:
"""GET with retries on transient transport errors (timeouts/conn resets)."""
"""GET, retrying on transient transport errors (timeouts/conn resets)."""
last_exc: httpx.TransportError | None = None
for attempt in range(retries + 1):
for attempt in range(1, max_attempts + 1):
try:
return await client.get(url, **kwargs)
except httpx.TransportError as e: # covers timeouts + connect/read errors
last_exc = e
logger.warning(
"GET %s failed (attempt %s/%s): %s", url, attempt + 1, retries + 1, e
"GET %s failed (attempt %s/%s): %s", url, attempt, max_attempts, e
)
await anyio.sleep(2)
raise last_exc # type: ignore[misc]