From e09e418b2fa8851fa7443fbe8e353bdc2b084e92 Mon Sep 17 00:00:00 2001 From: CodeWhale Bot Date: Wed, 23 Sep 2026 17:42:55 -0700 Subject: [PATCH] test(release): stop auto-maintenance racing the tag fixture cleanup Version drift failed on #6431, #6443 and #6456 with `rm: cannot remove '/tmp/tmp.*/checkout': Directory not empty` right after "require-release-tag-checkout tests passed": every assertion held, and only the EXIT trap failed. The fixture commits and pushes, which can spawn a detached `git maintenance run --auto` still writing into .git while the trap deletes it. Disable auto maintenance/gc for every git process in the fixture via GIT_CONFIG_COUNT, and retry the removal once. Verification: the fixture passes locally; shellcheck clean. The race was never reproduced locally, so the root cause is inferred from the log; CI reruns are the proof. Co-Authored-By: Claude Opus 5.5 (1M context) --- scripts/release/require-release-tag-checkout.test.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/release/require-release-tag-checkout.test.sh b/scripts/release/require-release-tag-checkout.test.sh index 148e3436a8..7704361263 100755 --- a/scripts/release/require-release-tag-checkout.test.sh +++ b/scripts/release/require-release-tag-checkout.test.sh @@ -3,7 +3,14 @@ set -euo pipefail repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" tmp_dir="$(mktemp -d)" -trap 'rm -rf "${tmp_dir}"' EXIT +# CI saw `rm: cannot remove '.../checkout': Directory not empty` here: a +# detached `git maintenance run --auto` (spawned by the fixture's commit and +# pushes) was still writing into .git while the trap deleted it. Keep every +# git process in this fixture from spawning one, and retry once regardless. +export GIT_CONFIG_COUNT=2 +export GIT_CONFIG_KEY_0=maintenance.auto GIT_CONFIG_VALUE_0=false +export GIT_CONFIG_KEY_1=gc.auto GIT_CONFIG_VALUE_1=0 +trap 'rm -rf "${tmp_dir}" 2>/dev/null || { sleep 1; rm -rf "${tmp_dir}"; }' EXIT remote="${tmp_dir}/remote.git" checkout="${tmp_dir}/checkout"