test: add tests for resolve_azure_model_name#244
Merged
gvanrossum merged 2 commits intomicrosoft:mainfrom Apr 23, 2026
Merged
Conversation
Addresses review comment from microsoft#241.
fb724c9 to
0d1f0df
Compare
The test expected DEFAULT_EMBEDDING_SPEC but OPENAI_EMBEDDING_MODEL in the environment overrode it, causing a spurious failure.
2 tasks
gvanrossum
approved these changes
Apr 23, 2026
Collaborator
gvanrossum
left a comment
There was a problem hiding this comment.
LG. Though next time please don't include reformatting of unrelated lines -- it distracts the reviewer from the crux of the PR.
gvanrossum
pushed a commit
that referenced
this pull request
Apr 23, 2026
## Summary - Bumps `max_retries` from the default (2) to 5 across all four `AsyncOpenAI`/`AsyncAzureOpenAI` construction sites (`create_async_openai_client` and `_make_azure_provider`) - The openai SDK's built-in exponential backoff handles transient 429s automatically — this just gives it more attempts - Three online tests (`test_ingest_podcast`, `test_query_method_basic`, `test_transcript_knowledge_extraction_slow`) were failing intermittently due to 429s ## Test plan - [x] `make check` (pyright) — 0 errors - [x] `pytest tests/test_model_adapters.py tests/test_utils.py` — 29/30 pass (1 pre-existing failure fixed in #244)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
resolve_azure_model_namecovering: deployment name extraction from endpoint, fallback to provided model name, and defaultAZURE_OPENAI_ENDPOINTenvvar usagetest_create_embedding_model_uses_azure_deployment_name— wasn't clearingOPENAI_EMBEDDING_MODELfrom the environment, so the assertion failed when that envvar was setTest plan
make check(pyright) — 0 errorspytest tests/test_utils.py tests/test_model_adapters.py— 33/33 passmake test— 496 pass, 3 fail (all transient 429 rate limits, addressed in fix: increase OpenAI client max_retries to handle 429 rate limits #245)