Skip to content

🌱 test(governance): stop background git gc from racing the fixture cleanup - #16412

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
quality/test-governance-fixture-cleanup
Nov 3, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
quality/test-governance-fixture-cleanup

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

runtime-tests on #16409 (run 41615043540, job 125846371394, runner hive-runners-lke-qh55w-runner-vfrnj) failed in .github/scripts/integration-governance.test.cjs test 6 with:

ENOTEMPTY: directory not empty, rmdir '/home/runner/hive/hive/.integration-governance-fixture/.git'

#16409 touches neither .github/scripts/ nor src/scripts/, so this is the fixture, not the PR. The test makes five commits into a throwaway repo under process.cwd() and then fs.rmSyncs it. git commit may fork git gc --auto into 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 own fixture must not overwrite another workspace precondition until actions/checkout cleans it.

Fix, following the materialize fixture's pattern of configuring git per-call:

  • -c gc.auto=0 -c maintenance.auto=false on 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 --auto timing — but the file's six existing tests pass locally (3 consecutive runs, node --test .github/scripts/integration-governance.test.cjs). Outside src/, 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

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>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 3, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

No conflicting open PRs or same-file overlaps were found.

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 3, 2026
@hivecommons-hive

hivecommons-hive Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

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`.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me — read the fixture at the PR head and the helper it drives.

Verified

  • The git wrapper (.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) are rev-list/rev-parse/show/diff plus worktree add/remove, none of which fork gc --auto, so -c gc.auto=0 -c maintenance.auto=false on 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.cjs at fd92805: 6/6 pass, 3 consecutive runs, .integration-governance-fixture gone 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

@hivecommons-hive
hivecommons-hive Bot merged commit 5dc4011 into v5 Nov 3, 2026
88 of 92 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-governance-fixture-cleanup branch November 3, 2026 10:21
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants