How to write a flaky test
summary
Concrete fixes for flaky tests: use Cypress intercept and wait to mock or synchronise API responses and assert loader/state checkpoints, isolate test data per parallel worker and run cleanup jobs outside tests, prefer browser-state caching with cy.session to avoid repeated UI logins (example cuts suites from 15h to 4h), avoid heavy abstraction that hides what tests do, remove hard waits and instead wait for specific network calls or elements, and monitor CI/staging performance so slow infra doesn’t induce flakiness.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:26What is test flakiness
- 4:57Why flakiness happens
- 6:43Flakiness from test coverage
- 9:30Network-related flakiness
- 12:23Execution and isolation issues
- 15:36Infrastructure problems
- 19:14Test performance and DRY
- 23:48Avoiding test idling
- 26:38Summary and key takeaways
- 27:20Q&A session
related talks
15mHow to (not) write a flaky test
46mFilip Hric: How to Write a Flaky Test Description: How (not) to Write a Flaky Test
22mTest Confidence: Types of Flake & How to Remediate
15mHow to Fix Flakiness in Tests | Using Time Machines to Debug #FlakyTest
38mFlakiness in your tests isn't down to test framework
28mTest flakiness; methods for dealing with flaky tests
29mCommon Mistakes that make test cases flaky and how to avoid them
48mFlaky Tests 2.0
