You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Turmoil is a framework for testing distributed systems. It provides
deterministic execution by running multiple concurrent hosts within a single
thread. It introduces "hardship" into the system via changes in the simulated
network and filesystem. Both can be controlled manually or with a seeded rng.
Quickstart
Add this to your Cargo.toml.
[dev-dependencies]
turmoil = "0.7"
See crate documentation for simulation setup instructions.
[dev-dependencies]
turmoil = { version = "0.7", features = ["unstable-fs"] }
Turmoil provides simulated filesystem types for crash-consistency testing:
use turmoil::fs::shim::std::fs::OpenOptions;use turmoil::fs::shim::std::os::unix::fs::FileExt;let file = OpenOptions::new().read(true).write(true).create(true).open("/data/db")?;
file.write_all_at(b"data",0)?;
file.sync_all()?;// Data now durable, survives sim.crash()
Each host has isolated filesystem state. Use Builder::fs_sync_probability() to
configure random sync behavior for testing crash recovery.
Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in turmoil by you, shall be licensed as MIT,
without any additional terms or conditions.