From 7973f1aaec69035b3be25dc044df54fe66f79547 Mon Sep 17 00:00:00 2001 From: Martin Vogel Date: Mon, 27 Jul 2026 06:31:40 +0200 Subject: [PATCH] ci(smoke): best-effort cleanup for the Windows version/security preflight dirs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The version preflight PASSED (both images printed their version) and then the job died in the cleanup trap: Windows keeps the just-exited image's file busy for ~100ms (section teardown / first-touch AV), so 'rm -rf' in the EXIT trap raced it — 'Device or resource busy', exit 1 on a job whose actual work was green (observed on windows-11-arm ui in dry run 30232946513). Temp-dir cleanup on an ephemeral runner is best-effort with one retry, never a gate. Signed-off-by: Martin Vogel --- .github/workflows/_smoke.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_smoke.yml b/.github/workflows/_smoke.yml index 1ef35f101..763fe3867 100644 --- a/.github/workflows/_smoke.yml +++ b/.github/workflows/_smoke.yml @@ -201,7 +201,10 @@ jobs: # runner workspace is deliberately not a valid launcher bundle root. PROFILE_ROOT="$(cygpath -u "$USERPROFILE")" LAUNCH_DIR="$(mktemp -d "$PROFILE_ROOT/cbm-release-version.XXXXXX")" - trap 'rm -rf "$LAUNCH_DIR"' EXIT + # Best-effort cleanup with one retry: Windows holds the just-exited + # image's file busy for ~100ms (section teardown / first-touch AV), + # and a temp dir on an ephemeral runner must never fail the job. + trap 'rm -rf "$LAUNCH_DIR" 2>/dev/null || { sleep 2; rm -rf "$LAUNCH_DIR" 2>/dev/null || true; }' EXIT cp "$ARTIFACT_DIR/codebase-memory-mcp.exe" \ "$ARTIFACT_DIR/codebase-memory-mcp.payload.exe" "$LAUNCH_DIR/" "$LAUNCH_DIR/codebase-memory-mcp.payload.exe" --version @@ -231,7 +234,8 @@ jobs: scripts/security-strings.sh "$ARTIFACT_DIR/codebase-memory-mcp.payload.exe" PROFILE_ROOT="$(cygpath -u "$USERPROFILE")" SECURITY_DIR="$(mktemp -d "$PROFILE_ROOT/cbm-release-security.XXXXXX")" - trap 'rm -rf "$SECURITY_DIR"' EXIT + # Best-effort cleanup with one retry (see the version preflight). + trap 'rm -rf "$SECURITY_DIR" 2>/dev/null || { sleep 2; rm -rf "$SECURITY_DIR" 2>/dev/null || true; }' EXIT cp "$ARTIFACT_DIR/codebase-memory-mcp.exe" \ "$ARTIFACT_DIR/codebase-memory-mcp.payload.exe" "$SECURITY_DIR/" TMPDIR="$SECURITY_DIR" \