Testing Time (and other asynchronous code)
summary
Describes a new approach that makes fast, reliable tests for async and time‑based Go code by running tests inside a controlled bubble where the time package uses a fake clock and tests call testing/synctest functions like Test and Wait to detect quiescence. It evolved from parsing runtime stacks to a proper runtime‑assisted package, works in production (now in Go 1.25), and still requires fake network or careful handling because IO and mutexes are not always durably blocked.
AI-written summary · about
chapters (8)
- 0:00The challenge of testing
- 2:05Flakiness in timing tests
- 6:00Approaches to testability
- 10:47Observing the runtime
- 12:35Introducing sync test
- 16:00Using the sync test bubble
- 23:00Durably blocking operations
- 28:59Final notes and history
related talks
30mHow to Test Asynchronous Code
46mTesting the untestable - patterns and use cases analysis
32mTesting in Go: from basic to advanced
34mSwift Testing: A testing framework for modern Swift
44mTesting the untestable - patterns and use cases analysis
45mTesting Asynchronous OTP
34mAdvanced Testing Techniques in Go
35mTest like a ninja with Go
