--- title: Debugging Tests description: Diagnose flaky or failing tests effectively --- # Debugging Tests When tests fail: 1. Reproduce locally with focused scope. 2. Inspect stack traces and assertions. 3. Isolate flaky dependencies (time, network, global state). 4. Stabilize with proper setup/teardown. Prefer fixing root causes over adding retries.