From 21e7d6c74b0ab3420241756629e3b25fda3d22e6 Mon Sep 17 00:00:00 2001 From: mathias Date: Sun, 26 Jul 2026 06:17:18 +0000 Subject: [PATCH] =?UTF-8?q?fix(ci):=20smoke=20test=20hung=2014min=20?= =?UTF-8?q?=E2=80=94=20buildah=20run=20doesn't=20die=20under=20plain=20tim?= =?UTF-8?q?eout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bare `/tapir` runs the long-running server, same as the old ctr-based smoke test. ctr's --rm reliably force-killed it; a plain `timeout N buildah run` does not — it only signals the wrapper, and the container process can survive that and keep the log pipe open, hanging the whole job (observed live: run 155, 14min before failure). Backgrounds the run and tears it down with `buildah rm -f`, which forcibly kills regardless of wrapper state, and captures output via a file instead of a blocking pipe. Refs infra#132. --- .gitea/workflows/ci.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index c670895..c663710 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -82,13 +82,28 @@ jobs: # avoids sudo/host-containerd access so this still works once the # runner itself is containerized (infra#132). Tests the local # buildah-store image directly, no registry round-trip needed. + # + # Bare `/tapir` (no subcommand) runs the long-running server, same as + # the old ctr-based smoke test -- ctr's --rm reliably force-killed it, + # but a plain `timeout N buildah run` does NOT: it only signals the + # `buildah run` wrapper, and the actual container process can survive + # that and keep the output pipe open, hanging the whole job (hit this + # live: 14min hang, infra#132). Backgrounding the run + `buildah rm -f` + # decouples "is the script blocked" from "did the process exit" -- + # rm -f forcibly tears down the container regardless of wrapper state. - name: Smoke test run: | REGISTRY="localhost:5000" REF="${REGISTRY}/${{ env.IMAGE }}:${{ steps.meta.outputs.sha-tag }}" CONTAINER=$(buildah from ${REF}) - OUTPUT=$(timeout 5 buildah run "$CONTAINER" -- /tapir 2>&1 || true) - buildah rm "$CONTAINER" >/dev/null + LOG=$(mktemp) + buildah run "$CONTAINER" -- /tapir > "$LOG" 2>&1 & + RUNPID=$! + sleep 5 + kill -9 "$RUNPID" 2>/dev/null || true + wait "$RUNPID" 2>/dev/null || true + buildah rm -f "$CONTAINER" >/dev/null 2>&1 || true + OUTPUT=$(cat "$LOG"); rm -f "$LOG" echo "$OUTPUT" | grep -q "tapir" \ && echo "Smoke test passed" \ || echo "Smoke test inconclusive: $OUTPUT"