PropertyDamage.Nemesis.ProcessKill (PropertyDamage v0.2.0)

View Source

Kill or crash processes to test fault tolerance.

Terminates processes by name or pattern, useful for testing supervision trees, process restart behavior, and system resilience.

Configuration

  • :target - What to kill: {:name, atom}, {:pattern, regex}, or {:random, count}
  • :signal - Kill signal: :kill, :shutdown, :normal, or custom reason
  • :restart_delay_ms - Wait before allowing restart (default: 0)
  • :duration_ms - For random kills, how long to keep killing (default: 0, one-shot)

Example

def commands do
  [
    {ProcessData, weight: 5},
    {PropertyDamage.Nemesis.ProcessKill, weight: 1}
  ]
end

Targets

  • {:name, :my_genserver} - Kill a specific named process
  • {:pattern, ~r/Worker/} - Kill processes matching pattern
  • {:random, 3} - Kill 3 random processes from the group
  • {:pid, pid} - Kill a specific PID (for testing)

Testing Behavior

After process kills, your system should:

  • Restart via supervisors
  • Maintain consistency during restarts
  • Not lose critical state