Flaky Test Investigation
Flaky tests erode trust in CI. Do not just re-run them and hope for the best.
Investigation Protocol
- Isolate the Test: Run the specific failing test by itself. If it passes, the flake is likely an order dependency or state leakage from a previous test.
- Stress Test: Run the test in a tight loop (e.g.,
for i in {1..100}; do npm test -- -t "My Test"; done). - Check for Common Vectors:
- Time: Does the test rely on
Date.now()or
- Time: Does the test rely on
[Description truncada. Veja o README completo no GitHub.]