Common Mistakes that make test cases flaky and how to avoid them
summary
Defines five concrete flakiness causes — timing and synchronization, environment/configuration, non‑isolated tests, third‑party dependencies, and poor test data management — and maps each to fixes: time‑freeze and Rails timezone config, DatabaseCleaner and FactoryBot, Capybara wait/content checks, and recorded HTTPs via VCR and WebMock. Recommends parallel jobs and rspec‑retry to isolate transient failures. Claims a 10k+ example suite goes from CI blocks (5 failures in a 1,049‑example container) to 100% green, ~50% RSpec time reduction and ~80% cost drop.
AI-written summary · about
chapters (7)
- 0:00Introduction to flaky tests
- 1:30Understanding test flakiness
- 5:23Common causes of flakiness
- 15:21Debugging strategies
- 16:28Prevention techniques
- 21:54Mitigation tools and habits
- 24:12Real-world success and Q&A
related talks
21mTaming Flaky Specs: Diagnosing Test Failures in Ruby
36mFixing Flaky Tests Like a Detective
34mEliminating Inconsistent Test Failures
42mDon't Let Your Tests Flake Out
41mDeterministic Solutions to Intermittent Failures
40mFinding Flakiness: The Real Reasons Your Tests Aren't Reliable
15mHow to (not) write a flaky test
06mAvoiding Sneaky Testing Antipatterns
