skills/smithery.ai/reviewing-flaky-tests

reviewing-flaky-tests

Installation
SKILL.md

Flaky Test Review

Priority Order

HIGH - Breaks tests unpredictably:

  • No alias: or overload: mocks - breaks parallel tests
  • No Http::sequence() in parallel - responses consumed unpredictably
  • Cache cleared BEFORE mocking - cache wins over mocks
  • createFromFormat() chains startOfDay() - preserves wall clock otherwise
  • Fakes BEFORE factory creation - afterCreating hooks run immediately
  • Passport::actingAs($user, ['scope']) includes scopes - 403 means missing scope

MEDIUM - Intermittent failures:

  • Time frozen with startOfMinute() - use startOfSecond() only when needed
  • Custom cleanup BEFORE parent::tearDown()
  • partialMock() before shouldReceive() on facades
  • Partial fakes: Bus::fake([SpecificJob::class]) - let others run
Installs
1
First Seen
Apr 9, 2026