fix: EXIT trap omits container teardown on script interruption (#862)

This commit is contained in:
openhands 2026-03-18 13:37:23 +00:00
parent f4201ee7ef
commit 044f8d41f8

View file

@ -51,7 +51,7 @@ SMOKE_SEED="${seeds[$SMOKE_IDX]}"
SMOKE_NAME=$(basename "$SMOKE_SEED" .push3)
log "Smoke test: $SMOKE_NAME"
cp "$OPT_SOL" "${OPT_SOL}.sweep-backup"
trap 'cp "${OPT_SOL}.sweep-backup" "$OPT_SOL" 2>/dev/null; rm -f "${OPT_SOL}.sweep-backup"' EXIT
trap 'cp "${OPT_SOL}.sweep-backup" "$OPT_SOL" 2>/dev/null; rm -f "${OPT_SOL}.sweep-backup"; docker compose -f "$REPO_ROOT/docker-compose.yml" down -v 2>/dev/null || true' EXIT
bash "$INJECT" "$SMOKE_SEED" "$OPT_SOL" || die "Smoke test inject failed for $SMOKE_NAME"
(cd "$REPO_ROOT/onchain" && forge build --silent 2>&1) || die "Smoke test compile failed for $SMOKE_NAME"