runner: fault injectors and attrition regimes are silently dropped when chaos_duration is unset

Open
#245 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
testing

Research direction

Start with SimulationBuilder::run, then read collect_fault_injectors in crates/moonpool-sim/src/runner/builder.rs:1216 and start_fault_injectors in crates/moonpool-sim/src/runner/orchestrator.rs:915. Done means runs with attritions or fault_factories but no chaos_duration return an error, and the fault_factory doc comment states the requirement.

Written by the indexing model from the issue text.

Description

bug release-blocker simulation

Found during the pre-release source audit of 8d9e779 (read-only, nothing compiled or run). Severity: high. Status: confirmed.

Where

  • crates/moonpool-sim/src/runner/orchestrator.rs:915 (start_fault_injectors)
  • crates/moonpool-sim/src/runner/builder.rs:1216 (collect_fault_injectors)

What

collect_fault_injectors builds one injector per fault_factory and one AttritionInjector per Chaos::Attrition entry. start_fault_injectors then returns an empty handle list when chaos_duration is None, dropping every injector unrun. No warning, no assertion. Network and storage chaos still apply because they are configuration on SimWorld, so the run visibly injects faults while attrition and every custom injector do nothing. fault_factory's doc comment never mentions the requirement.

Failure scenario

.enable_chaos([Chaos::Network(ChaosMode::Swarm), Chaos::Attrition { .. }]) without .chaos_duration(..): network faults fire, zero reboots happen, the campaign reports 100% success.

Decision (taken)

Fail run() with an error. The no-backward-compatibility policy covers callers relying on the silent drop.

Proposed fix

In SimulationBuilder::run, return an error when attritions or fault_factories is non-empty and chaos_duration is None. Mention the requirement in the fault_factory doc.

Dominant language
Rust
Stars
49
Forks
3
Avg merge
1h 4m
Merged PRs (30d)
41

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PierreZ/moonpool

All issues in PierreZ/moonpool

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.