Skip to content

test(cli): TestConcurrentFinalizeElectsExactlyOneWriter fails intermittently in CI across unrelated PRs #3658

Description

@biggs-100

📝 Bug Description

TestConcurrentFinalizeElectsExactlyOneWriter (internal/cli/review_lock_contention_test.go) fails intermittently in the hosted Unit Tests lane. We have observed two occurrences on unrelated PRs within ~13 hours, in both cases while every other lane (Windows Runtime, Darwin, all E2E lanes, organic runtimes) passed and recent main runs were green:

Both PRs touch entirely different subsystems (doctor symlink handling and Git object-format lookup respectively), so the failure does not track either change. The assertion message in both logs is the same shape:

review_lock_contention_test.go:266: approved compact authority survived at
/tmp/TestConcurrentFinalizeElectsExactlyOneWriter<suffix>/.git/gentle-ai/review-transactions/v2/review-986db52f8b6e253d: <nil>

This points at a race window in the concurrent finalize election: under contention, one writer observes the approved compact authority as absent (<nil>) where the test requires it to have survived.

The subsystem overlaps open #3572 (late finalize recreating burned lineage), but that issue reports a user-facing behavioral defect while this is an intermittent assertion failure of the contention test itself, so they may share a root without being the same report. The closed history of this area (#2181, #1982, #1861) shows prior races were each classified and fixed individually; this tracker exists so the intermittent stops consuming required merge-check lanes one PR at a time.

🔄 Steps to Reproduce

Not reproduced locally; both occurrences are hosted-CI runs of the full unit suite. Reproduction attempt guidance: run go test ./internal/cli/ -run TestConcurrentFinalizeElectsExactlyOneWriter -count=100 on a loaded multi-core runner and inspect for the <nil> survival assertion at line 266.

✅ Expected Behavior

Either the election has no such race (test passes deterministically), or the test tolerates only legitimate interleavings explicitly, with any tolerated outcome documented in the test rather than masked by a retry.

❌ Actual Behavior

The required merge-check unit lane fails intermittently on unrelated changes, forcing re-runs and occasionally blocking unrelated contributions.

🌍 Environment

Hosted GitHub Actions Ubuntu runners; internal/cli/review_lock_contention_test.go; observed against current main ancestry of both PRs above.

💡 Logs / Error Output

--- FAIL: TestConcurrentFinalizeElectsExactlyOneWriter (0.54s)
    review_lock_contention_test.go:266: approved compact authority survived at
    /tmp/TestConcurrentFinalizeElectsExactlyOneWriter2238138274/004/.git/gentle-ai/review-transactions/v2/review-986db52f8b6e253d: <nil>

(Second occurrence shows the same shape with a different temp suffix and 0.58s.)

Activity

  1. egdev6 commented on Sep 19, 2026

    @egdev6
    SponsorContributor

    Closing — audit outcome close-technical

    This issue was closed as technically resolved as part of the open-backlog audit.

    • Audit verdict: partition actionable, value insufficient, technical status surface-absent, disposition close-technical.
    • Why this closes: the surface this report describes does not exist in this repository (technical status surface-absent).
    • Closure path: close-now; the technical status is deliberately retained as surface-absent.

    Reopen conditions — reopen instead of re-filing if: (1) the reported behaviour is reproduced on the current release with exact versions and configuration; (2) a concrete artefact shows the failure is produced by a Gentle AI-managed path; or (3) a maintainer decides the underlying request is back in scope. The individual audit report keeps the full evidence and the reopen conditions.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions