mutation-table: delete the dead cur branch of the cleanup trap

The --rm mutant container is gone by the time the trap runs, so
`docker rm -f $cur` never had a container to remove. The stopgap's watchdog
kills every job-labelled container before it signals the driver, so nothing
needs tracking here. Also restores a line continuation the control-run edit
had collapsed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-01 18:25:36 +02:00
commit 838b859423

View file

@ -111,9 +111,9 @@ if [ "$1" = --host ]; then
bundle=${MT_BUNDLE:?}
set +e # every docker step is checked by hand: a mutant container exits non-zero by design
base="$YGG_CNAME-base"; snap="eureka-mt-$YGG_CNAME:snap"
cur=
# A TERM waits for the foreground container (bounded by MUT_TIMEOUT); the stopgap's watchdog kills every
# job-labelled container before it signals this driver, so cleanup has no running mutant to stop.
cleanup() {
[ -z "$cur" ] || sudo docker rm -f "$cur" >/dev/null 2>&1 || true
sudo docker rm -f "$base" >/dev/null 2>&1 || true
sudo docker rmi -f "$snap" >/dev/null 2>&1 || true
[ -z "$bundle" ] || [ "$bundle" = / ] || rm -rf -- "$bundle"
@ -148,7 +148,8 @@ if [ "$1" = --host ]; then
# fixture) is green in the baseline and red in every mutant's container, which would read as a fully
# killed suite. The control is the baseline's tests run once more from the snapshot, unmutated.
# shellcheck disable=SC2086
drun --rm --name "$YGG_CNAME-ctl" "${common[@]}" -w /src ${DOCKER_ARGS:-} "$snap" bash -o pipefail -c "$pre; bash /mt/mutation-table.sh --control"
drun --rm --name "$YGG_CNAME-ctl" "${common[@]}" -w /src ${DOCKER_ARGS:-} "$snap" \
bash -o pipefail -c "$pre; bash /mt/mutation-table.sh --control"
rc=$?
[ "$rc" = 0 ] || { echo "$SUMTAG: the unmutated snapshot is red though the baseline was green, so no mutant result would mean anything; no rows counted"; exit "$rc"; }
@ -157,7 +158,6 @@ if [ "$1" = --host ]; then
if [ -n "${YGG_KILLED:-}" ] && [ -e "$YGG_KILLED" ]; then
echo "$SUMTAG: JOB KILLED by the watchdog before mutant $n of $count; the finished rows above stand"; exit 124
fi
cur="$YGG_CNAME-m$n"
# shellcheck disable=SC2086
drun --rm --name "$YGG_CNAME-m$n" "${common[@]}" -w /src ${DOCKER_ARGS:-} "$snap" \
bash -o pipefail -c "$pre; bash /mt/mutation-table.sh --mutant $n"