forked from mtusi2026/mtusi2026lab3
Implement Lab 3 grade 4 messenger balancing
This commit is contained in:
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
run_name=${1:-run1}
|
||||
mkdir -p evidence
|
||||
bash scripts/recover-api.sh
|
||||
load_json="evidence/failover-$run_name-load.json"
|
||||
load_log="evidence/failover-$run_name-load.log"
|
||||
failover_log="evidence/failover-$run_name.log"
|
||||
python3 tests/load.py --duration 40 --concurrency 4 --output "$load_json" >"$load_log" 2>&1 &
|
||||
load_pid=$!
|
||||
sleep 2
|
||||
set +e
|
||||
python3 tests/resilience.py --mode failover --action-script scripts/stop-one.sh --base-url http://localhost:8080 2>&1 | tee "$failover_log"
|
||||
scenario_status=${PIPESTATUS[0]}
|
||||
set -e
|
||||
if ! wait "$load_pid"; then
|
||||
printf 'Background load scenario failed; inspect %s.\n' "$load_log" >&2
|
||||
exit 1
|
||||
fi
|
||||
exit "$scenario_status"
|
||||
Reference in New Issue
Block a user