Skip to content

feat(infra): add chaos engineering and resilience test suite (fixes #413) - #440

Open
beulah7717108-eng wants to merge 1 commit into
AetherEdu:mainfrom
beulah7717108-eng:feat/issue-413-chaos-engineering
Open

feat(infra): add chaos engineering and resilience test suite (fixes #413)#440
beulah7717108-eng wants to merge 1 commit into
AetherEdu:mainfrom
beulah7717108-eng:feat/issue-413-chaos-engineering

Conversation

@beulah7717108-eng

Copy link
Copy Markdown

Summary

Implements the chaos engineering and resilience test suite defined in #413.

What was added

Experiment scripts (scripts/chaos/experiments/):

  • redis-failure.sh — Simulates complete Redis unavailability, verifies circuit breaker behaviour, asserts graceful degradation, and validates recovery
  • redis-latency.sh — Injects 500ms of Redis latency, validates response time stays within tolerance
  • mongo-failure.sh — Stops MongoDB, verifies no backend crash, asserts health remains reachable
  • rpc-failure.sh — Blocks outbound Stellar/Soroban RPC traffic, validates non-blockchain endpoints continue functioning
  • pod-termination.sh — Sends SIGKILL to the backend container, measures RTO against a 60s budget

Orchestrator (scripts/chaos/run-experiments.sh):

  • Runs experiments individually or as a suite (--experiment redis|mongo|rpc|pod|all)
  • Dry-run mode (--dry-run) for safe preview
  • Staging mode (--staging) to enable destructive experiments
  • Produces structured JSON result files and a consolidated summary

CI workflow (.github/workflows/chaos.yml):

  • Runs weekly on Sunday at 06:00 UTC
  • Triggerable on demand via workflow_dispatch
  • Runs on PRs that touch chaos scripts/workflow
  • Results uploaded as artifacts retained for 90 days
  • Matches the project's "report, don't block" posture

Documentation (docs/infrastructure/chaos-engineering.md):

  • Experiment catalogue with expected behaviour per experiment
  • Runbook for interpreting results and diagnosing failures
  • RTO/RPO targets aligned with the multi-region failover contract
  • Feedback loop for feeding findings into platform improvements

Acceptance criteria

  • Chaos experiments defined for key dependencies (Redis, MongoDB, RPC)
  • Experiments run in a controlled environment (CI + docker compose)
  • Assertions verify graceful degradation and recovery
  • Results reported in CI (artifacts + run summary)
  • Findings feed back into resilience fixes (runbook + feedback loop template)

Testing

# Dry-run validation
scripts/chaos/run-experiments.sh --dry-run

# Run all non-destructive experiments
scripts/chaos/run-experiments.sh

# Run specific experiments
scripts/chaos/run-experiments.sh --experiment redis

Closes #413

…etherEdu#413)

Implement chaos experiments for key platform dependencies (Redis,
MongoDB, Stellar RPC) with automated assertions that verify graceful
degradation and recovery. Experiments include:

- redis-failure: complete Redis unavailability with circuit breaker
  verification
- redis-latency: 500ms latency injection with response time thresholds
- mongo-failure: MongoDB container termination with crash detection
- rpc-failure: Stellar RPC endpoint blocking with connectivity checks
- pod-termination: backend container SIGKILL with RTO measurement

The orchestration script produces structured JSON reports, supports
dry-run mode, and is integrated into CI via a weekly scheduled GitHub
Actions workflow with workflow_dispatch support for on-demand runs.

Documentation includes a comprehensive resilience runbook with
interpreting results, common failure causes, and a feedback loop for
feeding findings into platform improvements.

Closes AetherEdu#413
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.

[Infrastructure] Chaos engineering and resilience test suite

1 participant