Filip Hric: How to Write a Flaky Test Description: How (not) to Write a Flaky Test
summary
Test flakiness breaks trust and slows delivery; fixing it requires concrete changes not slogans. Use Cypress or Playwright features: replace racing DOM selectors with deterministic checks like asserting element counts, remove network timing by cy.intercept empty array mock for the initial GET so the list is always empty, and avoid repeated UI logins by using cy.session caching login so backend is called once instead of 100 times. Also isolate parallel runs with separate test accounts and clean or seed staging data to stop infrastructure-driven flakes.
AI-written summary · about
chapters (12)
- 0:00Test flakiness introduction
- 5:27Coping with flaky tests
- 8:16Flakiness from test suites
- 11:51Network flakiness solutions
- 16:08Parallel execution isolation
- 19:19Infrastructure flakiness causes
- 22:09Performance and abstraction
- 26:25Avoiding timeouts
- 30:18Scaling and flakiness axes
- 31:22Q&A tools and mocking
- 39:32Q&A desktop apps and parallelism
- 45:43Closing remarks
related talks
15mHow to (not) write a flaky test
32mHow 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
48mFlaky Tests 2.0
28mTest flakiness; methods for dealing with flaky tests
38mFlakiness in your tests isn't down to test framework
42mFlaky tests are a pain
