From 8034f56f3b2f7a716a5b02831a33f51f3ea23d87 Mon Sep 17 00:00:00 2001 From: James Ding Date: Fri, 9 Jan 2026 13:28:17 -0800 Subject: [PATCH 1/2] feat: mark all integration tests as flaky with auto-retry --- tests/integration/conftest.py | 8 ++++++++ tests/integration/test_tts_websocket_integration.py | 2 -- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 6426e17..fbff4a4 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -12,6 +12,14 @@ load_dotenv() + +def pytest_collection_modifyitems(items): + """Mark all integration tests as flaky with auto-retry.""" + for item in items: + # Check if test is in the integration directory + if "integration" in str(item.fspath): + item.add_marker(pytest.mark.flaky(reruns=9, reruns_delay=1)) + # Create output directory for test audio files OUTPUT_DIR = Path("output") OUTPUT_DIR.mkdir(exist_ok=True) diff --git a/tests/integration/test_tts_websocket_integration.py b/tests/integration/test_tts_websocket_integration.py index 5014dab..5e80321 100644 --- a/tests/integration/test_tts_websocket_integration.py +++ b/tests/integration/test_tts_websocket_integration.py @@ -34,7 +34,6 @@ def text_stream(): # Save the audio save_audio(audio_chunks, "test_websocket_streaming.mp3") - @pytest.mark.flaky(reruns=9, reruns_delay=1) @pytest.mark.parametrize( "model", [ @@ -226,7 +225,6 @@ async def text_stream(): save_audio(audio_chunks, "test_async_websocket_streaming.mp3") @pytest.mark.asyncio - @pytest.mark.flaky(reruns=9, reruns_delay=1) @pytest.mark.parametrize( "model", [ From 9c4795ab50d36d4ec517a1f802fb9b8161434c13 Mon Sep 17 00:00:00 2001 From: James Ding Date: Fri, 9 Jan 2026 13:29:41 -0800 Subject: [PATCH 2/2] feat: add extra line for readability in conftest.py --- tests/integration/conftest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index fbff4a4..df76c03 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -20,6 +20,7 @@ def pytest_collection_modifyitems(items): if "integration" in str(item.fspath): item.add_marker(pytest.mark.flaky(reruns=9, reruns_delay=1)) + # Create output directory for test audio files OUTPUT_DIR = Path("output") OUTPUT_DIR.mkdir(exist_ok=True)