From f2b6152ec2448b4ea877153d6a613c381e7fd8bb Mon Sep 17 00:00:00 2001 From: "Kevin H. Luu" Date: Fri, 18 Sep 2026 03:40:32 -0700 Subject: [PATCH] [CI] Add flaky rerun markers / timeout skips to sibling tests lacking them (#57359) Signed-off-by: khluu Co-authored-by: Kimi --- .../pooling/test_token_classification.py | 2 ++ tests/multimodal/media/test_connector.py | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/models/language/pooling/test_token_classification.py b/tests/models/language/pooling/test_token_classification.py index d8d813f404..c205a3c42a 100644 --- a/tests/models/language/pooling/test_token_classification.py +++ b/tests/models/language/pooling/test_token_classification.py @@ -115,6 +115,7 @@ def test_modernbert_models( @pytest.mark.parametrize("model", ["Davlan/xlm-roberta-base-ner-hrl"]) @pytest.mark.parametrize("dtype", ["float"]) +@pytest.mark.flaky(reruns=3) @torch.inference_mode def test_xlm_roberta_models( hf_runner, @@ -197,6 +198,7 @@ def test_openai_privacy_filter( @pytest.mark.parametrize("model", ["bd2lcco/Qwen3-0.6B-finetuned"]) @pytest.mark.parametrize("dtype", ["float"]) +@pytest.mark.flaky(reruns=3) @torch.inference_mode def test_auto_conversion( hf_runner, diff --git a/tests/multimodal/media/test_connector.py b/tests/multimodal/media/test_connector.py index b222d57d3c..5949c66b56 100644 --- a/tests/multimodal/media/test_connector.py +++ b/tests/multimodal/media/test_connector.py @@ -299,6 +299,7 @@ async def test_fetch_video_http(video_url: str, num_frames: int): assert metadata_sync == metadata_async +@pytest.mark.flaky(reruns=3, reruns_delay=5) @pytest.mark.asyncio @pytest.mark.parametrize("video_url", TEST_VIDEO_URLS) @pytest.mark.parametrize("max_duration", [1, 60, 1800]) @@ -320,8 +321,11 @@ async def test_fetch_video_http_with_dynamic_loader( } ) - video_sync, metadata_sync = connector.fetch_video(video_url) - video_async, metadata_async = await connector.fetch_video_async(video_url) + try: + video_sync, metadata_sync = connector.fetch_video(video_url) + video_async, metadata_async = await connector.fetch_video_async(video_url) + except (TimeoutError, asyncio.TimeoutError) as e: + pytest.skip(f"Timeout fetching video (CI network flakiness): {e}") assert np.array_equal(video_sync, video_async) assert metadata_sync == metadata_async @@ -379,6 +383,7 @@ def test_placeholder_range_extract_embeds_range(offset, is_embed, expected): assert pr.extract_embeds_range() == expected +@pytest.mark.flaky(reruns=3, reruns_delay=5) @pytest.mark.asyncio @pytest.mark.parametrize("video_url", TEST_VIDEO_URLS) @pytest.mark.parametrize("num_frames", [-1, 32, 1800]) @@ -394,8 +399,12 @@ async def test_allowed_media_domains(video_url: str, num_frames: int): ], ) - video_sync, metadata_sync = connector.fetch_video(video_url) - video_async, metadata_async = await connector.fetch_video_async(video_url) + try: + video_sync, metadata_sync = connector.fetch_video(video_url) + video_async, metadata_async = await connector.fetch_video_async(video_url) + except (TimeoutError, asyncio.TimeoutError) as e: + pytest.skip(f"Timeout fetching video (CI network flakiness): {e}") + assert np.array_equal(video_sync, video_async) assert metadata_sync == metadata_async