-
Notifications
You must be signed in to change notification settings - Fork 2
implemented new fault system #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements a new fault injection system that replaces probability-based faults with a more controllable mechanism. The system allows faults to be enabled/disabled by name and supports forcing specific fault triggers, making it more suitable for integration testing scenarios.
Key changes:
- Introduced a new
FaultEntrystructure with enable/disable and forced-trip capabilities via atomic operations - Renamed
maybe_fault!macro tosometimes_fault!and removed the probability parameter - Added fault catalog initialization and lookup functions (
get_fault_by_name,enable_all,disable_all)
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/fault.rs | New module implementing the fault catalog and FaultEntry structure with atomic-based control mechanisms |
| src/macros.rs | Updated fault macro from maybe_fault to sometimes_fault, removed probability parameter, integrated with new fault system |
| src/macros_stubs.rs | Renamed stub macro to match new sometimes_fault naming |
| src/lib.rs | Integrated fault initialization into the main init flow, removed old global fault enable/disable functions |
| src/dispatch.rs | Added choose helper function for random selection from slices |
| src/random.rs | Removed inline attributes from RngCore implementation |
| src/catalog.rs | Fixed grammatical error in comment ("it's" → "its") |
| src/dispatch/antithesis.rs | Fixed spelling error ("initalization" → "initialization") |
| src/dispatch/test.rs | Removed inline attribute from random method |
| src/dispatch/noop.rs | Removed inline attribute from random method |
| .zed/settings.json | Added editor-specific configuration (non-code change) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ys cause a trigger
The new fault system allows faults to be turned on/off by name or to force the next fault trip to trigger. This makes it easier to use faults in integration tests where you may want to force a specific fault to trigger.