faultkit 0.1.0

Fault injection for testing error paths — fail the Nth syscall and verify graceful handling
Documentation
  • Coverage
  • 100%
    46 out of 46 items documented7 out of 7 items with examples
  • Size
  • Source code size: 46.17 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.62 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 38s Average build duration of successful builds.
  • all releases: 38s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • santhsecurity/faultkit
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • santhsecurity

faultkit

Fault injection for testing error paths. Fail the Nth syscall and verify graceful handling.

Usage

use faultkit::FaultInjector;

let injector = FaultInjector::new();

// Fail the 3rd allocation
injector.set_fail_at(3);

// Your code runs normally for 2 allocations, then the 3rd fails
// Verify your code handles the failure gracefully

Why

Testing error paths is hard. Most code has unwrap() or ? on operations that "never fail" — until they do in production. faultkit lets you systematically test every error path by failing operations at specific points.

License

MIT