Launching TestFlows Machine: self-serve deterministic simulation testing environment Read the post

Open-source

Framework

Python library for writing test programs.
Using the everything-is-code approach.

test.py

1
2
3
4
from testflows.core import Scenario

with Scenario("Hello TestFlows"):
pass

terminal

$ python3 ./test.py
✔ [ OK ] /Hello TestFlows

1 scenario (1 ok)
Total time 2ms

Stop hoping the bug happens again.

Race conditions, timing issues, and network failures show up once in a while, and almost never when you are looking for them. Machine runs your real, unmodified Linux x86_64 software, from a single binary to a Docker Compose project, in a machine that controls time, interrupts, random numbers and the thread schedule. Every run can be replayed exactly and branched from any point.

So instead of running a test thousands of times, you name the race and make it happen.

See a missed wakeup forced and fixed
The missed wakeup in missed-wakeup.c The waiter checks done under the lock, sees 0, and drops the lock at line 75. While Machine holds it before line 76, the signaler takes the lock, sets done to 1, signals and unlocks. The signal wakes nobody. The waiter then retakes the lock, waits at line 86, and times out after 50 ms with done already 1. Waiter Shared state (mutex, done) Signaler lock67 sees done == 069 unlock75 Machine holds waiter after unlock, before relock lock106 done = 1107 signal wakes nobody✕108 unlock109 lock76 pthread_cond_timedwait()86 50 ms, nobody signals ETIMEDOUT with done == 1: FAILURE: missed wakeup
Machine holds the waiter between unlocking and relocking the mutex. The signal is lost, and the waiter times out, on the first try.

From a failure to a verified fix.

01

Record every run

Every run is recorded as it executes. A replay repeats it exactly, to the instruction, as often as you like.

Replay

02

Branch from any point

Checkpoint the whole machine and fork a branch from any point. Each branch goes its own way while the original stays as it was.

Checkpoints and branches

03

Force the bug

Hold a thread in a race window, fail the exact system call, or delay a packet, and make the machine produce the failure the code points at.

Steering programs

04

Debug at any point

Read registers, memory and the stack, set breakpoints and watchpoints, or run GDB inside the machine, at any point of any run.

Debugging

05

Verify the fix

Run the same interleaving against your fix. When it passes, you know the fix holds, not just that the failure has not shown up yet.

See an example
Exploring the state space together A mesh of the states a program can reach, running left to right from a single start, each state leading to the neighbouring states of the next step. Your agent's path, highlighted, ends where it found a failure. From a shared point along it, your own branch takes a different path, a passing run. shared pointfailure foundpassing runyour agentyoustart
Every run is one path through the state space of your software. You and your agent explore it together.

Built for AI agents. Controlled by you.

Agents do the heavy lifting, while you stay in the loop and can see every step they take, repeat it, and take over at any point. Your agent drives Machine through the same machine client that you use, and the Python SDK gives both of you full programmatic control.

Install the Machine skill, ask your agent what Machine can do for your project, and it sets things up with you.

A deterministic hypervisor is only the beginning.

A complete deterministic simulation testing system manages recordings, checkpoints and branches, controls execution, injects faults, debugs failures and explores schedules, and makes all of it work together reliably. Machine provides the whole system and runs it for you as a cloud service.

What a deterministic simulation testing system takes A stack of layers. At the top, you and your AI coding agent. Below, the machine CLI, the Python SDK and the Agent skill; execution control, fault injection, debugging and schedules; recordings, checkpoints, branches and replay; your software and its containers; then the foundation of three layers, Linux in the machine, the deterministic hypervisor and host Linux; and at the bottom, cloud infrastructure with sessions on demand. A bracket marks every layer below you and your agent as TestFlows Machine, with your software shown as yours. You and your AI coding agentmachine CLI · Python SDK · Agent skillExecution control · Fault injection · Debugging · SchedulesRecordings · Checkpoints · Branches · ReplayYour software and its containersLinux in the machineDeterministic hypervisorHost LinuxCloud infrastructure · Sessions on demand TestFlowsMachine DST foundation

Your first run in five minutes.

Drive Machine from your terminal with the machine client, from your programs with the Python SDK, or let your coding agent drive it with the Machine skill. The same commands, either way.

machine sessions create first --cpus 2
machine disks build --from python:3.12-slim --add hello.py hello -- python hello.py
machine create hello-run --disk hello
machine run hello-run --until halted
machine output hello-run -n -5 --plain

Join the community.

The TestFlows Framework and the Machine Python SDK are open source, and so are Machine's examples. The skill for coding agents is public on GitHub. Report issues, ask questions and share what you find.

From the blog

Introducing TestFlows Machine: Deterministic Simulation Testing for Everyone

Introducing TestFlows Machine: Deterministic Simulation Testing for Everyone

A self-serve deterministic simulation testing (DST) environment for developers and AI coding agents has been a long time coming, and today we’re introducing TestFlows Machine to make that vision a reality. Because for many teams, deterministic simulation testing has changed how some of the most reliable software systems are built and tested. It gives you control over software execution, lets you inject failures, and makes runs reproducible, enabling you to investigate bugs that might otherwise take days to reproduce, or never show up again at all. However, getting there has usually meant walking a steep path that starts with building a custom system yourself, specific to your project, or diving into the development of a deterministic hypervisor for a more generic approach. That takes specialized knowledge, infrastructure, and a significant investment, and most teams would rather spend that time and tokens on their own software. And our vision is different. ...

Vitaliy Zakaznikov

Read the blog

Test programs, steps, combinatorial coverage, behavior models, and more.

Read all posts

Talk to our team