Skip to content

Conversation

lucasalencarxisto-stack

…sertions
What

  • Added async test coverage for per-request timeouts overriding default values.
  • Added complementary tests for smaller per-request timeouts triggering TimeoutException.
  • Extended retries tests to cover Retry-After headers, max retries exceeded, and server error retries.

Why
The previous test suite covered only basic sync cases. This change ensures:

  • Async clients behave consistently with sync clients.
  • Retry logic respects Retry-After headers and maximum retry counts.
  • The SDK surfaces the expected exceptions under different timeout/retry scenarios.

How

  • Created tests/test_timeouts_async.py with detailed assertions on timeout extraction.
  • Expanded tests/test_retries.py with more scenarios for retry handling.
  • Ensured tests run with httpx.MockTransport to simulate API responses deterministically.

Result
All timeout/retry logic is now covered by both sync and async tests, increasing confidence and preventing regressions.

@lucasalencarxisto-stack lucasalencarxisto-stack requested a review from a team as a code owner August 31, 2025 23:37
@lucasalencarxisto-stack
Copy link
Author

Hi OpenAI team 👋

This PR extends the test coverage for timeouts and retries:

Adds async tests for per-request timeouts overriding client defaults.

Covers the case where smaller per-request timeouts trigger TimeoutException.

Expands retries tests for Retry-After handling, server errors, and max retries exceeded.

All changes are backward-compatible (tests only). Please let me know if you'd like me to adjust the structure, naming, or add more scenarios. Happy to iterate based on your feedback!

Thanks for reviewing 🙏

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