This repository was archived by the owner on Apr 8, 2026. It is now read-only.
Description Feature Request
The chaos module exists in the library but is not exposed via CLI flags. Add CLI support for chaos testing.
Current State
// src/chaos.rs exists with:
pub struct ChaosConfig {
pub memory_limit : usize ,
pub cpu_limit : f64 ,
pub timeout : Duration ,
pub signal_injection : bool ,
// ... network and byzantine features behind feature flags
}
But renacer --help shows no chaos-related flags.
Proposed CLI Flags
# Basic chaos
renacer --chaos-memory-limit 64M -- ./target/debug/my-app
renacer --chaos-cpu-limit 0.5 -- ./target/debug/my-app
renacer --chaos-timeout 10s -- ./target/debug/my-app
renacer --chaos-signals -- ./target/debug/my-app
# Presets
renacer --chaos gentle -- ./target/debug/my-app
renacer --chaos aggressive -- ./target/debug/my-app
# Combined with tracing
renacer -c --chaos aggressive -- aprender-shell suggest " git "
Use Cases
Robustness testing - Find crashes under resource pressure
Timeout validation - Ensure graceful handling of slow operations
Memory leak detection - Limit memory and observe behavior
CI integration - Run tests with chaos to find edge cases
Example Session
$ renacer --chaos aggressive -c -- aprender-shell suggest " git "
⚠️ Chaos mode enabled: memory=64MB, cpu=25%, timeout=10s, signals=on
git status 1.000
% time seconds usecs/call calls errors syscall
...
🔴 Chaos events:
- Memory limit reached at 58MB (92% of limit)
- 2 SIGALRM signals injected and handled
- Execution completed in 8.2s (under 10s timeout)
Implementation Notes
Use ChaosConfig::gentle() and ChaosConfig::aggressive() presets
Wire up to clap args in main.rs
Apply limits via setrlimit for memory/cpu
Signal injection via kill(pid, signal) at random intervals
Related
Useful for testing aprender-shell robustness (#89 in aprender)
Extends existing anomaly detection with fault injection
Reactions are currently unavailable
Feature Request
The
chaosmodule exists in the library but is not exposed via CLI flags. Add CLI support for chaos testing.Current State
But
renacer --helpshows no chaos-related flags.Proposed CLI Flags
Use Cases
Example Session
Implementation Notes
ChaosConfig::gentle()andChaosConfig::aggressive()presetsclapargs in main.rssetrlimitfor memory/cpukill(pid, signal)at random intervalsRelated