diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index a1770f934..1a417826f 100644 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -13,6 +13,9 @@ SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" cd "${REPO_ROOT}" +# Broad test runs must be deterministic; dedicated autotune tests opt in per test. +export FLYDSL_AUTOTUNE=0 + # Auto-select GPU with the most free VRAM (skip if HIP_VISIBLE_DEVICES is already set). if [[ -z "${HIP_VISIBLE_DEVICES:-}" ]] && command -v python3 &>/dev/null; then _best_gpu=$(python3 -c " diff --git a/tests/unit/test_autotune.py b/tests/unit/test_autotune.py index 8e97bf605..8fd90d514 100644 --- a/tests/unit/test_autotune.py +++ b/tests/unit/test_autotune.py @@ -386,7 +386,8 @@ def default(a, out): # ── two-track default/search ───────────────────────────────────────────── def test_cache_hit_precedes_default_and_search(monkeypatch): - monkeypatch.delenv("FLYDSL_AUTOTUNE", raising=False) + # The broad test runner uses the explicit off value; search stays opt-in. + monkeypatch.setenv("FLYDSL_AUTOTUNE", "0") default_calls = 0 def fn(a, out, BLOCK):