Advanced Echo Server Logo

Advanced Echo Server

Go-powered testing, load simulation & chaos engineering

Scenarios

Define custom response sequences for specific paths using YAML files or the /scenario API. Scenarios cycle through predefined responses to simulate complex behaviors.

How It Works

graph TD
  A[Receive Request] --> B{Match Path}
  B -->|Scenario Found| C[Get Next Response]
  B -->|No Scenario| D[Default Echo]
  C --> E[Apply Status, Body, Headers, Delay]
  E --> F[Update Cycle Index]
  F --> G[Respond]
  D --> G

YAML Scenarios

Load scenarios from a YAML file specified by ECHO_SCENARIO_FILE (default: scenarios.yaml).

- path: /api/users
  responses:
    - status: 200
      delay: 100ms
      headers:
        Content-Type: application/json
      body: '{"users": []}'
    - status: 500
      delay: 200ms
      body: '{"error": "db failure"}'

Requests to /api/users cycle through responses (200, 500).

Scenario API

Dynamically update scenarios via /scenario endpoint.

curl -X POST http://localhost:8080/scenario -H "Content-Type: application/json" -d '[
  {
    "path": "/test",
    "responses": [
      {"status": 200, "body": "OK", "delay": "100ms"},
      {"status": 429, "body": "Too Many Requests"}
    ]
  }
]'
# Response: {"status": "scenarios updated"}
curl /test  # Returns 200, then 429, cycling

Notes