gameday.sh44 lines, 1.1 KB
| 1 | # A game day: one fault after another, while go run ./cmd/chaos sends |
| 2 | # transfers. Every line this prints shows up on the harness's timeline. |
| 3 | set -eu |
| 4 | wallet=http://localhost:8474/proxies/wallet/toxics |
| 5 | |
| 6 | sleep 10 |
| 7 | echo "the wallet crashes" |
| 8 | docker compose kill wallet |
| 9 | sleep 15 |
| 10 | docker compose start wallet |
| 11 | echo "the wallet is back" |
| 12 | |
| 13 | sleep 10 |
| 14 | echo "the transfer service crashes" |
| 15 | docker compose kill transfer |
| 16 | sleep 10 |
| 17 | docker compose start transfer |
| 18 | echo "the transfer service is back" |
| 19 | |
| 20 | sleep 10 |
| 21 | echo "NATS goes down" |
| 22 | docker compose stop nats |
| 23 | sleep 30 |
| 24 | docker compose start nats |
| 25 | echo "NATS is back" |
| 26 | |
| 27 | sleep 10 |
| 28 | echo "the network to the wallet slows down" |
| 29 | curl -sf -o /dev/null $wallet --json '{"name": "slow", "type": "latency", "attributes": {"latency": 2500}}' |
| 30 | sleep 20 |
| 31 | curl -sf -X DELETE $wallet/slow |
| 32 | echo "the network is fast again" |
| 33 | |
| 34 | sleep 10 |
| 35 | echo "the network to the wallet is cut" |
| 36 | curl -sf -o /dev/null $wallet --json '{"name": "cut", "type": "timeout", "attributes": {"timeout": 0}}' |
| 37 | sleep 15 |
| 38 | curl -sf -X DELETE $wallet/cut |
| 39 | echo "the network is back" |
| 40 | |
| 41 | sleep 10 |
| 42 | echo "Postgres restarts" |
| 43 | docker compose restart postgres |
| 44 | echo "Postgres is back" |