https://github.com/santhsecurity/faultkit
Fault injection for testing error paths
https://github.com/santhsecurity/faultkit
Last synced: 2 months ago
JSON representation
Fault injection for testing error paths
- Host: GitHub
- URL: https://github.com/santhsecurity/faultkit
- Owner: santhsecurity
- License: mit
- Created: 2026-04-08T23:42:23.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-04-09T00:01:30.000Z (4 months ago)
- Last Synced: 2026-04-09T01:23:06.906Z (4 months ago)
- Language: Rust
- Size: 26.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# faultkit
Fault injection for testing error paths. Fail the Nth syscall and verify graceful handling.
## Usage
```rust
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