Skip to content

ci(tests): retry transient platform 503/403 errors#39

Merged
abhishekmishragithub merged 1 commit into
mainfrom
ci/retry-transient-platform-errors
May 20, 2026
Merged

ci(tests): retry transient platform 503/403 errors#39
abhishekmishragithub merged 1 commit into
mainfrom
ci/retry-transient-platform-errors

Conversation

@abhishekmishragithub

Copy link
Copy Markdown
Collaborator

Wraps platform API calls in test_snippets.py with a 3-attempt retry (2s backoff) so transient 5xx/4xx 'Service temporarily unavailable' responses don't fail the scheduled run. Verified locally — 8/8 tests pass.

test_sync_synthesis and test_transcribe_url fail intermittently on
scheduled CI when the smallest.ai backend returns 503/403 with
"Service temporarily unavailable". Wrap platform API calls in a
3-attempt retry with 2s backoff. GitHub URL HEAD checks are left
unwrapped — they have a different purpose.
@vercel

vercel Bot commented May 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
smallest-showcase Ready Ready Preview, Comment May 11, 2026 0:27am

@entelligence-ai-pr-reviews

Copy link
Copy Markdown

EntelligenceAI PR Summary

Adds retry logic with exponential backoff to the test suite in docs/tests/test_snippets.py to handle transient HTTP failures.

  • Added _is_transient() helper to detect transient HTTP errors (5xx, 403, 429)
  • Added _retry() wrapper executing up to 3 attempts with exponential backoff using time.sleep
  • Replaced subprocess import with time to support backoff delays
  • Updated all six API call sites across TestTTS and TestSTT to use _retry(lambda: ...) wrappers

Confidence Score: 5/5 - Safe to Merge

Safe to merge — this PR adds well-scoped retry logic with exponential backoff to docs/tests/test_snippets.py to handle transient HTTP failures (5xx, 403, 429) in CI without introducing any new risks. The _is_transient() helper correctly classifies retriable error codes, and _retry() caps attempts at 3 with time.sleep-based backoff, which is appropriate for a test-only context. The replacement of the unused subprocess import with time is a clean improvement. No review comments were generated and heuristic analysis found zero issues across all severity levels.

Key Findings:

  • _is_transient() correctly targets known retriable HTTP status codes (5xx, 403, 429), avoiding over-broad retry logic that could mask real failures
  • _retry() limits to 3 attempts with exponential backoff, which is a standard, safe pattern for flaky CI tests and won't cause infinite loops or significant delay accumulation
  • All six API call sites in TestTTS and TestSTT are consistently wrapped with _retry(lambda: ...), meaning the coverage of the fix is complete and uniform
  • Removing the unused subprocess import and adding time is a minimal, correct dependency change appropriate to the functionality being added
Files requiring special attention
  • docs/tests/test_snippets.py

@abhishekmishragithub abhishekmishragithub merged commit ed43915 into main May 20, 2026
3 checks passed
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.

1 participant