Skip to content

Commit 7973f1a

Browse files
committed
ci(smoke): best-effort cleanup for the Windows version/security preflight dirs
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 <martin.vogel.tech@gmail.com>
1 parent 657d4b0 commit 7973f1a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎.github/workflows/_smoke.yml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,10 @@ jobs:
201201
# runner workspace is deliberately not a valid launcher bundle root.
202202
PROFILE_ROOT="$(cygpath -u "$USERPROFILE")"
203203
LAUNCH_DIR="$(mktemp -d "$PROFILE_ROOT/cbm-release-version.XXXXXX")"
204-
trap 'rm -rf "$LAUNCH_DIR"' EXIT
204+
# Best-effort cleanup with one retry: Windows holds the just-exited
205+
# image's file busy for ~100ms (section teardown / first-touch AV),
206+
# and a temp dir on an ephemeral runner must never fail the job.
207+
trap 'rm -rf "$LAUNCH_DIR" 2>/dev/null || { sleep 2; rm -rf "$LAUNCH_DIR" 2>/dev/null || true; }' EXIT
205208
cp "$ARTIFACT_DIR/codebase-memory-mcp.exe" \
206209
"$ARTIFACT_DIR/codebase-memory-mcp.payload.exe" "$LAUNCH_DIR/"
207210
"$LAUNCH_DIR/codebase-memory-mcp.payload.exe" --version
@@ -231,7 +234,8 @@ jobs:
231234
scripts/security-strings.sh "$ARTIFACT_DIR/codebase-memory-mcp.payload.exe"
232235
PROFILE_ROOT="$(cygpath -u "$USERPROFILE")"
233236
SECURITY_DIR="$(mktemp -d "$PROFILE_ROOT/cbm-release-security.XXXXXX")"
234-
trap 'rm -rf "$SECURITY_DIR"' EXIT
237+
# Best-effort cleanup with one retry (see the version preflight).
238+
trap 'rm -rf "$SECURITY_DIR" 2>/dev/null || { sleep 2; rm -rf "$SECURITY_DIR" 2>/dev/null || true; }' EXIT
235239
cp "$ARTIFACT_DIR/codebase-memory-mcp.exe" \
236240
"$ARTIFACT_DIR/codebase-memory-mcp.payload.exe" "$SECURITY_DIR/"
237241
TMPDIR="$SECURITY_DIR" \

0 commit comments

Comments
 (0)