From ce46dece237c92c23253273e28bde6aa8775e6b9 Mon Sep 17 00:00:00 2001 From: Jinfeng Date: Tue, 8 Sep 2026 22:28:12 +0000 Subject: [PATCH] TST: mark test_set_stats_level as thread_unsafe cuFile stats level is process-global state (a C library global variable inside libcufile). Running test_set_stats_level concurrently with test_stats_start_stop (which also calls set_stats_level(1)) can cause a race condition where get_stats_level() returns the value set by the other test, failing the assertion. All other cuFile stats tests (test_stats_start_stop, test_get_stats_l1/l2/l3) were already marked thread_unsafe; this commit fixes the oversight for test_set_stats_level. --- cuda_bindings/tests/test_cufile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cuda_bindings/tests/test_cufile.py b/cuda_bindings/tests/test_cufile.py index 7de4ceb2e20..055f9018175 100644 --- a/cuda_bindings/tests/test_cufile.py +++ b/cuda_bindings/tests/test_cufile.py @@ -1520,6 +1520,7 @@ def stats(driver): cufileVersionLessThan(1150), reason="cuFile parameter APIs require cuFile library version 13.0 or later" ) @pytest.mark.usefixtures("stats") +@pytest.mark.thread_unsafe(reason="cuFile stats level is process-global") def test_set_stats_level(): """Test cuFile statistics level configuration.""" # Test setting different statistics levels