From 165ed33327c04db3e26c6e433f721a1f68754558 Mon Sep 17 00:00:00 2001 From: Andreas Karatzas Date: Thu, 30 Jul 2026 05:42:03 -0500 Subject: [PATCH] [CI][ROCm] Stabilize LLM GC teardown check (#50340) Signed-off-by: Andreas Karatzas --- tests/basic_correctness/test_basic_correctness.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/basic_correctness/test_basic_correctness.py b/tests/basic_correctness/test_basic_correctness.py index 810a3a0aee..4f99120c0c 100644 --- a/tests/basic_correctness/test_basic_correctness.py +++ b/tests/basic_correctness/test_basic_correctness.py @@ -78,6 +78,15 @@ def _resolve_target_test_suite() -> str: TARGET_TEST_SUITE = _resolve_target_test_suite() +# ROCm can occasionally retain the object until fixture teardown. Retry only +# that assertion after cleanup; collecting cyclic garbage here would mask the +# reference cycles this test is intended to catch. +@pytest.mark.flaky( + reruns=2, + reruns_delay=5, + only_rerun="AssertionError", + condition=current_platform.is_rocm(), +) def test_vllm_gc_ed(): """Verify vllm instance is GC'ed when it is deleted""" llm = LLM("hmellor/tiny-random-LlamaForCausalLM")