From 2915739dda078d98cc2c1d7cd05832f677c1a592 Mon Sep 17 00:00:00 2001 From: Hugh Perkins Date: Thu, 23 Apr 2026 22:12:05 -0700 Subject: [PATCH 1/2] [Test] Suppress stock pytest-timeout to avoid conflict with pytest_hardtle The self-hosted AMD GPU runner has pytest-timeout installed in its Python tool cache. When pytest_hardtle (our CFFI-based hard timeout plugin) tries to register the same hooks, pytest raises a ValueError. Adding `-p no:timeout` before `-p pytest_hardtle` prevents the stock plugin from loading. --- tests/run_tests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/run_tests.py b/tests/run_tests.py index a454003002..36059493cc 100644 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -52,6 +52,8 @@ def _test_python(args, default_dir="python"): pytest_args += [ "--durations=15", "-p", + "no:timeout", + "-p", "pytest_hardtle", f"--timeout={args.timeout}", ] From f85f00b9909008d48581ce076f282e65dffb0808 Mon Sep 17 00:00:00 2001 From: Hugh Perkins Date: Thu, 23 Apr 2026 23:57:09 -0700 Subject: [PATCH 2/2] Add clarifying comments for pytest_hardtle and no:timeout flags Explain why we suppress stock pytest-timeout (hook conflict) and why we use pytest_hardtle (CFFI native signal handler kills GIL-held GPU hangs). --- tests/run_tests.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/run_tests.py b/tests/run_tests.py index 36059493cc..06227f836e 100644 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -51,8 +51,14 @@ def _test_python(args, default_dir="python"): if args.timeout > 0: pytest_args += [ "--durations=15", + # Suppress stock pytest-timeout if installed — it conflicts + # with pytest_hardtle (both register the same hook specs). "-p", "no:timeout", + # pytest_hardtle uses a CFFI-compiled C watchdog that calls + # _exit(1) from a native signal handler, so it can kill tests + # hung in native GPU calls even when the GIL is held. + # Stock pytest-timeout's signal method cannot do this. "-p", "pytest_hardtle", f"--timeout={args.timeout}",