Skip to content

Conversation

@carlsverre
Copy link
Contributor

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.

Copilot AI review requested due to automatic review settings December 10, 2025 23:31
Copy link

Copilot AI left a 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 FaultEntry structure with enable/disable and forced-trip capabilities via atomic operations
  • Renamed maybe_fault! macro to sometimes_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.

@carlsverre carlsverre enabled auto-merge December 11, 2025 07:50
@carlsverre carlsverre merged commit 2723f35 into main Dec 11, 2025
3 checks passed
@carlsverre carlsverre deleted the feat/fault branch December 11, 2025 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant