Skip to content
Testing·Intermediate·Coding·1 min read

What is a common cause of flaky tests around async code?

Short interview answer

Uncontrolled nondeterminism — real timers, real randomness, unmocked network variance, or race conditions between two async operations — makes outcomes depend on timing that differs between runs instead of being deterministic.

Key takeaway

Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.

← Back to Mocking, test doubles, and async tests

Related questions