fix(tests): metrics test improved to avoid race conditions

This commit is contained in:
Emilio Garcia 2025-10-30 13:37:41 -04:00
parent 25051f1bf0
commit 0a6c180631
3 changed files with 15 additions and 5 deletions

View file

@ -7,7 +7,6 @@
"""Telemetry test configuration supporting both library and server test modes."""
import os
import time
import pytest
@ -60,8 +59,6 @@ def llama_stack_client(telemetry_test_collector, request):
@pytest.fixture
def mock_otlp_collector(telemetry_test_collector):
"""Provides access to telemetry data and clears between tests."""
# prevent race conditions between tests caused by 200ms metric collection interval
time.sleep(0.3)
telemetry_test_collector.clear()
try:
yield telemetry_test_collector