Living with flaky tests
summary
Shows concrete causes and fixes: Ember + QUnit tests flake from hidden asynchrony (dynamic imports for highlight.js in a syntax-highlighter modifier) and from leaked global state (tests pass or fail depending on order or QUnit seed). Reproduce by forcing the flaky test to always fail, then fix by registering async work with waitForPromise (em-test-waiters) or by scoping globals (reset in beforeEach or use Ember Browser Window service). Skipping hides the real bug.
AI-written summary · about
chapters (6)
- 0:00Understanding flaky tests
- 1:57Test-driven development
- 7:07Methodical debugging
- 9:34Solving timing issues
- 25:08Addressing leaky state
- 33:23The value of flaky tests
related talks
15mHow to (not) write a flaky test
21mTesting against time in JavaScript applications
42mDon't Let Your Tests Flake Out
38mFlakiness in your tests isn't down to test framework
32mHow to write a flaky test
36mFixing Flaky Tests Like a Detective
15mHow to Fix Flakiness in Tests | Using Time Machines to Debug #FlakyTest
28mTest flakiness; methods for dealing with flaky tests
