Resources
Eradicating Nondeterminism in Tests with Undo
Stability is crucial in any software system, and eradicating nondeterminism in tests is key to achieving it. Whether you’re building networking software, a mission-critical financial trading system, or a large-scale database, nothing threatens stability quite like nondeterministic bugs: intermittent failures that seem to appear and disappear without reason.
These so-called flaky tests are more than just an annoyance; they consume engineering time, erode trust in your CI/CD pipeline, and delay releases. The good news is that you can eradicate them, systematically and efficiently, with the help of Undo.
Why eradicating nondeterminism in tests matters
A nondeterministic failure is one that doesn’t happen every time you run your test. Sometimes it passes, sometimes it fails. The root causes may include:
- Race conditions
- Uninitialized memory
- Timing-related concurrency bugs
- External dependencies or unpredictable system behavior
These failures are notoriously difficult to reproduce, let alone fix. Yet left unresolved, they undermine confidence in your software quality and your release process.
Undo: Deterministic debugging for nondeterministic bugs
The Undo Suite offers a revolutionary approach to debugging by allowing you to record, replay, and time travel through the execution of your application. Its core tool, LiveRecorder, captures an exact, bit-for-bit recording of a test’s execution, making even the most elusive failures fully reproducible and debuggable.
When LiveRecorder is used with our Thread Fuzzing feature, it becomes even more powerful by provoking race conditions to fail.
A race that only happened once in a blue moon now becomes 100% reproducible.
Systematically hunting down flaky tests
Here’s the real power of Undo: you can automate the process of catching and diagnosing flaky tests. By setting up a mechanism that automatically re-runs failing or flaky tests under Undo’s recording, you turn nondeterministic bugs into deterministic, debuggable sessions with no manual reproduction required.
Workflow example:
- CI test fails intermittently – The flaky test is automatically flagged.
- Automatic rerun under recording – The test is re-run using LiveRecorder, with our Thread Fuzzing feature enabled to reproduce multi-threaded race conditions quickly. This can be done with a simple command like
live-record --thread-fuzzing <process>, where<process>is the name of the process you’d like to record – you don’t even need to recompile your application! This produces a recording capturing every detail of the failure in a file like<process>-<pid>-<date>.undo. - Recording file archived – The recording is stored centrally, perhaps by attaching it to a bug report.
- Root cause analysis with time travel debugging – Developers load the recording in UDB (Undo’s integrated debugger) with a command like
udb <process>-<pid>-<date>.undo, step backwards through the recorded execution, and pinpoint the root cause. - Fix with confidence – Once fixed, the test can be re-run to verify stability.

Benefits of eradicating nondeterminism for high stakes software
For teams building:
- Networking & security software – where system availability and robustness are paramount;
- Databases – where a single inconsistent result can break application logic;
- Trading and market data platforms – where performance and correctness must coexist under extreme data loads;
- Computational software handling large-scale simulations or modeling;
Undo provides the deterministic control and deep insight needed to ensure stability at scale.
Final thoughts
Eradicating flaky, nondeterministic test failures isn’t just about making your test suite green: it’s about building software you and your customers can trust. By integrating Undo into your CI pipeline, you create a systematic, reliable process for identifying and resolving the root causes of instability.
If your test suite has nondeterministic failures (and almost every mature codebase does) Undo gives you the tools to find them, understand them, and eradicate them for good.
Want to see it in action?