[CI] Add flaky rerun markers / timeout skips to sibling tests lacking them (#57359)
Signed-off-by: khluu <khluu000@gmail.com> Co-authored-by: Kimi <noreply@moonshot.cn>
Kevin H. Luu committed
Sep 18, 2026 at 03:40 UTC
f2b6152ec2448b4ea877153d6a613c381e7fd8bb
2 files changed
+15
-4
tests/models/language/pooling/test_token_classification.py
+2
@@ -115,6 +115,7 @@ def test_modernbert_models(
115
116
@pytest.mark.parametrize("model", ["Davlan/xlm-roberta-base-ner-hrl"])
117
@pytest.mark.parametrize("dtype", ["float"])
118
+@pytest.mark.flaky(reruns=3)
119
@torch.inference_mode
120
def test_xlm_roberta_models(
121
hf_runner,
@@ -197,6 +198,7 @@ def test_openai_privacy_filter(
198
199
@pytest.mark.parametrize("model", ["bd2lcco/Qwen3-0.6B-finetuned"])
200
@pytest.mark.parametrize("dtype", ["float"])
201
+@pytest.mark.flaky(reruns=3)
202
@torch.inference_mode
203
def test_auto_conversion(
204
hf_runner,
tests/multimodal/media/test_connector.py
+13
-4
@@ -299,6 +299,7 @@ async def test_fetch_video_http(video_url: str, num_frames: int):
299
assert metadata_sync == metadata_async
300
301
302
+@pytest.mark.flaky(reruns=3, reruns_delay=5)
303
@pytest.mark.asyncio
304
@pytest.mark.parametrize("video_url", TEST_VIDEO_URLS)
305
@pytest.mark.parametrize("max_duration", [1, 60, 1800])
@@ -320,8 +321,11 @@ async def test_fetch_video_http_with_dynamic_loader(
321
}
322
)
323
323
- video_sync, metadata_sync = connector.fetch_video(video_url)
324
- video_async, metadata_async = await connector.fetch_video_async(video_url)
324
+ try:
325
+ video_sync, metadata_sync = connector.fetch_video(video_url)
326
+ video_async, metadata_async = await connector.fetch_video_async(video_url)
327
+ except (TimeoutError, asyncio.TimeoutError) as e:
328
+ pytest.skip(f"Timeout fetching video (CI network flakiness): {e}")
329
330
assert np.array_equal(video_sync, video_async)
331
assert metadata_sync == metadata_async
@@ -379,6 +383,7 @@ def test_placeholder_range_extract_embeds_range(offset, is_embed, expected):
383
assert pr.extract_embeds_range() == expected
384
385
386
+@pytest.mark.flaky(reruns=3, reruns_delay=5)
387
@pytest.mark.asyncio
388
@pytest.mark.parametrize("video_url", TEST_VIDEO_URLS)
389
@pytest.mark.parametrize("num_frames", [-1, 32, 1800])
@@ -394,8 +399,12 @@ async def test_allowed_media_domains(video_url: str, num_frames: int):
399
],
400
)
401
397
- video_sync, metadata_sync = connector.fetch_video(video_url)
398
- video_async, metadata_async = await connector.fetch_video_async(video_url)
402
+ try:
403
+ video_sync, metadata_sync = connector.fetch_video(video_url)
404
+ video_async, metadata_async = await connector.fetch_video_async(video_url)
405
+ except (TimeoutError, asyncio.TimeoutError) as e:
406
+ pytest.skip(f"Timeout fetching video (CI network flakiness): {e}")
407
+
408
assert np.array_equal(video_sync, video_async)
409
assert metadata_sync == metadata_async
410