Repository navigation
🌱 test(governance): stop background git gc from racing the fixture cleanup - #16412
Conversation
The pinned-helpers test commits several times into a throwaway repo under the workspace, then rmSync()s it. git commit may fork 'git gc --auto' into the background, and when that process is still writing under .git the cleanup fails with ENOTEMPTY. On a persistent self-hosted runner the half-removed fixture then trips the next run's 'must not overwrite another workspace' precondition. Disable auto gc/maintenance for the fixture's git calls and let rmSync retry transient errors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Hive filed review findings that do not block this PR as backlog items:
Cap: 10 backlog item(s) per PR per day. Evidence bundle `#16412fd92805` sha256:dccc3c314006eb4423ffb3b67e25fe1791ef98c3b2979e65a1933c44bce23298 — download from the dashboard or `hivectl review evidence #16412`. |
There was a problem hiding this comment.
Looks correct to me — read the fixture at the PR head and the helper it drives.
Verified
- The
gitwrapper (.github/scripts/integration-governance.test.cjs:86-88) is the only path for every fixture write:init,add,commit,checkout,merge,commit-tree(lines 109–142). The helper's own git calls (integration-governance.cjs:68-152) arerev-list/rev-parse/show/diffplusworktree add/remove, none of which forkgc --auto, so-c gc.auto=0 -c maintenance.auto=falseon the wrapper closes the whole window. rmSync(..., {maxRetries: 10, retryDelay: 100})are supported Node options and already used in-repo (src/scripts/dashboard-mobile-shots.mjs:249).node --test .github/scripts/integration-governance.test.cjsatfd92805: 6/6 pass, 3 consecutive runs,.integration-governance-fixturegone afterwards.
Pre-existing, not introduced here (suggestion only): env at line 81 spreads process.env, so on a host that exports GIT_AUTHOR_NAME/GIT_AUTHOR_EMAIL (as hive agent shells do) the merge at line 123 is authored by the host identity while the hard-coded Signed-off-by: Fixture Author no longer matches, and check('dco', …) at line 128 fails with Generated merge lacks its own actual author signoff. Same on base, so unrelated to this PR; blanking GIT_AUTHOR_*/GIT_COMMITTER_* in env (as it already does for GITHUB_TOKEN) would make the fixture hermetic on such hosts.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Test Improvement
runtime-testson #16409 (run 41615043540, job 125846371394, runnerhive-runners-lke-qh55w-runner-vfrnj) failed in.github/scripts/integration-governance.test.cjstest 6 with:#16409 touches neither
.github/scripts/norsrc/scripts/, so this is the fixture, not the PR. The test makes five commits into a throwaway repo underprocess.cwd()and thenfs.rmSyncs it.git commitmay forkgit gc --autointo the background; when that child is still writing under.git, the recursive remove races it and fails. Worse, on a persistent self-hosted workspace the half-removed directory survives, and the next run on that runner fails the test's ownfixture must not overwrite another workspaceprecondition untilactions/checkoutcleans it.Fix, following the materialize fixture's pattern of configuring git per-call:
-c gc.auto=0 -c maintenance.auto=falseon every fixture git invocation, so no background process outlives a commit.rmSync(..., {maxRetries: 10, retryDelay: 100})so a transient ENOTEMPTY/EBUSY during teardown is retried instead of failing the test and leaving the directory behind.No test is added for the race itself — it only reproduces under real
gc --autotiming — but the file's six existing tests pass locally (3 consecutive runs,node --test .github/scripts/integration-governance.test.cjs). Outsidesrc/, so changelog-exempt.Refs #16409 (the PR whose runtime-tests lane this flake turned red; its own fix is unrelated)
Filed by quality agent (ACMM L4/L6 — full mode)
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88