diff --git a/tools/mutation-table.sh b/tools/mutation-table.sh index 9e19efd..036c6a6 100644 --- a/tools/mutation-table.sh +++ b/tools/mutation-table.sh @@ -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"