From ed3ffd2de1dd71b74b8721b5a3ffa2472a50e8dc Mon Sep 17 00:00:00 2001 From: ciregenz Date: Fri, 5 Jun 2026 00:55:14 -0700 Subject: [PATCH] [eric] tests: reset metrics-dir cache in conftest, analyzer tests wrote to a stale dir --- backend/tests/conftest.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/tests/conftest.py b/backend/tests/conftest.py index e12dc5ec..e17c9835 100644 --- a/backend/tests/conftest.py +++ b/backend/tests/conftest.py @@ -28,6 +28,13 @@ def _isolate_browser_state(monkeypatch): m.clear(wipe_disk=True) except Exception: pass + # metrics caches its dir at first use; drop it so each test writes + # where ITS env var points, not where the first test's pointed + try: + from backend.apps.agents.browser import browser_metrics as _bm + _bm._metrics_dir_cache = None + except Exception: + pass _reset() yield _reset()