Flaky Test Review
Priority Order
HIGH - Breaks tests unpredictably:
MEDIUM - Intermittent failures:
LOW - Silent bugs:
Quick Reference
For detailed patterns and examples:
- Time patterns: See references/time-patterns.md
- Freezing, createFromFormat trap, back-to-back records, DataProviders
- Mock patterns: See references/mock-patterns.md
- Alias mocks, partialMock, container binding, partial fakes
- Isolation patterns: See references/isolation-patterns.md
- Storage::fake, observable events, Sushi models, tearDown order
- Assertion patterns: See references/assertion-patterns.md
- Boolean assertions, Money, timestamps, exceptions
Observable Events Risk
| Risk |
Examples |
Action |
| HIGH |
External API, notifications |
Always disable |
| MEDIUM |
DB side-effects, cache |
Disable if not testing |
| LOW |
UUID generation |
Usually safe |
Validation
Run the pattern detector on your test file:
php .claude/skills/flaky-test-reviewer/scripts/validate.php path/to/YourTest.php
Verification
# Repeat test to catch intermittent failures
php artisan test --filter=TestName --repeat=100