From 097095c1ea7741558fc30e4af742f869307db61e Mon Sep 17 00:00:00 2001 From: Giles Odigwe Date: Thu, 30 Apr 2026 11:42:18 -0700 Subject: [PATCH] Fix Ollama pull failure propagation and Azure OpenAI vector store readiness - Ollama CI: fail the step immediately if model pull fails after 3 retries instead of silently proceeding to tests - Azure OpenAI file search: add the same vector-store readiness polling that was applied to the non-Azure OpenAI tests, preventing eventual consistency race conditions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/python-integration-tests.yml | 6 ++++++ .github/workflows/python-merge-tests.yml | 6 ++++++ .../tests/openai/test_openai_chat_client_azure.py | 10 ++++++++++ 3 files changed, 22 insertions(+) diff --git a/.github/workflows/python-integration-tests.yml b/.github/workflows/python-integration-tests.yml index 9887b667a9..0d8ae36b8f 100644 --- a/.github/workflows/python-integration-tests.yml +++ b/.github/workflows/python-integration-tests.yml @@ -195,13 +195,19 @@ jobs: done # Pull models with retry for transient 429 rate limits for model in qwen2.5:1.5b nomic-embed-text; do + pulled=false for attempt in 1 2 3; do if ollama pull "$model"; then + pulled=true break fi echo "Retry $attempt for $model (waiting 15s)..." sleep 15 done + if [ "$pulled" != "true" ]; then + echo "ERROR: Failed to pull $model after 3 attempts" + exit 1 + fi done working-directory: . - name: Start local MCP server diff --git a/.github/workflows/python-merge-tests.yml b/.github/workflows/python-merge-tests.yml index 2e6851e476..ea20ad06e8 100644 --- a/.github/workflows/python-merge-tests.yml +++ b/.github/workflows/python-merge-tests.yml @@ -313,13 +313,19 @@ jobs: done # Pull models with retry for transient 429 rate limits for model in qwen2.5:1.5b nomic-embed-text; do + pulled=false for attempt in 1 2 3; do if ollama pull "$model"; then + pulled=true break fi echo "Retry $attempt for $model (waiting 15s)..." sleep 15 done + if [ "$pulled" != "true" ]; then + echo "ERROR: Failed to pull $model after 3 attempts" + exit 1 + fi done working-directory: . - name: Start local MCP server diff --git a/python/packages/openai/tests/openai/test_openai_chat_client_azure.py b/python/packages/openai/tests/openai/test_openai_chat_client_azure.py index b16fbd0f7f..fe25a7202d 100644 --- a/python/packages/openai/tests/openai/test_openai_chat_client_azure.py +++ b/python/packages/openai/tests/openai/test_openai_chat_client_azure.py @@ -2,6 +2,7 @@ from __future__ import annotations +import asyncio import os from functools import wraps from pathlib import Path @@ -77,6 +78,15 @@ async def create_vector_store(client: OpenAIChatClient) -> tuple[str, Content]: if result.last_error is not None: raise RuntimeError(f"Vector store file processing failed with status: {result.last_error.message}") + # Wait for the vector store index to be fully searchable. + # create_and_poll confirms file processing, but the search index is eventually consistent. + for _ in range(10): + vs = await client.client.vector_stores.retrieve(vector_store.id) + if vs.file_counts.completed >= 1 and vs.file_counts.in_progress == 0: + break + await asyncio.sleep(1) + await asyncio.sleep(2) + return file.id, Content.from_hosted_vector_store(vector_store_id=vector_store.id)