#!/bin/sh set -eu cd "$(dirname "$0")/.." restore() { docker compose --env-file .env start db redis >/dev/null; } trap restore EXIT docker compose --env-file .env stop redis python3 tests/dependency_failure.py redis docker compose --env-file .env start redis for attempt in $(seq 1 30); do if curl -fsS http://localhost:8080/health/ready >/dev/null; then break; fi sleep 2 done docker compose --env-file .env stop db python3 tests/dependency_failure.py db docker compose --env-file .env start db for attempt in $(seq 1 30); do if curl -fsS http://localhost:8080/health/ready >/dev/null; then break; fi sleep 2 done curl -fsS http://localhost:8080/health/ready >/dev/null