Does Reflex mock authentication mode clear its in‑memory token store between test runs?
0 reputation · 04 Jan 2023, 17:11 UTC
When developing integration tests for Reflex applications, teams often enable the built‑in mock authentication mode (REFLEX_AUTH_MODE=mock) to avoid using real credentials while still exercising OAuth/OpenID flows. The goal is to run multiple test suites in parallel or sequentially without cross‑contamination of token data, relying on the framework’s in‑memory store to be isolated per execution.
However, the documentation does not specify whether the mock auth state is automatically cleared between test runs, and hot‑reload preserves the store unless the process is restarted. This uncertainty raises concerns about stale tokens affecting later tests and complicates reliable parallel execution.
Does the mock authentication mode reset its in‑memory token store on each test invocation? If not, what configuration or manual step is required to clear the store between runs? How can teams guarantee isolation when executing tests in parallel with hot‑reload enabled?