Skip to content

Add chaos/fault-injection tests: simulated RPC failures / partially-applied storage updates #28

Description

@P3az3

Problem Statement Existing tests run in Env::default() with deterministic success paths. They do not test what happens when a host-side storage read returns a stale value, when extend_ttl is exhausted, or when a panic during mid-mutation leaves the contract in an unexpected state. Soroban's host guarantees are strong but not actually tested in this repo.

Expected Outcome A new test file chaos_tests.rs that exercises:

  • Env::budget() exhaustion mid-donate (does the storage revert?).
  • Forced eviction via env.storage().persistent().set of a non-existent key after a write attempt (triggers extend_ttl panic under the old code; should now no-op).
  • Two parallel donate calls from the same donor in the same test (using env.ledger().with_mut_transaction or two Env instances).
  • Panic during release_milestone (assert campaign state unchanged).

Acceptance Criteria

  • New test file with at least 5 chaos scenarios.
  • Each scenario asserts post-state correctness.
  • A documented expectation table distinguishes "Soroban guarantee" vs "host implementation detail."

Implementation Notes

  • This is high-value but harder to maintain — keep scope small.

Affected Files / Modules

  • New: campaign/src/test/chaos_tests.rs
  • campaign/src/test/mod.rs

Dependencies — None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26chaos-engineeringResilience / fault-injection testing.priority/p2Should-do in current quarter.testingTest coverage or tooling.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions