Skip to content

CI flake: 'canonical update retains the gate's completed retirement on a later busy file' fails intermittently on ubuntu #245

Closed

Description

@abogartz

Finding

PR #243 run 41333886059 (head d9be220, branch touching only e2e/): the test job failed once with:

  • (fail) canonical update retains the gate's completed retirement on a later busy file [8.58ms] — expect(...superseded_by).toBeDefined() at test/lock-partial-outcomes.test.ts:109
  • plus an Unhandled error between tests from appendLog (src/logfmt.ts:96) via record (src/evidence.ts:116)

Rerun of the same commit: green (841→842 pass). Main has been green on every recent push. The PR diff cannot affect this test (e2e/-only), so it is a pre-existing ubuntu-runner flake in the held-file (0444) race family: the gate's durable-retirement step and the evidence appendLog fault injection appear to race the harness's hold window, and the unhandled rejection lands between tests.

Suspect shape

The test expects the gate to complete the retirement of the FIRST row before the busy-file failure strikes the second write; if the evidence append (a fire-and-forget record) rejects outside the awaited path, superseded_by may not yet be durable at assertion time — or the hold does not bite as intended on the ubuntu filesystem for the exact line the test aims at.

Fix direction

Reproduce under gh run stress (rerun the test job N times on ubuntu), then either await the evidence record inside the held window or gate the assertion on a settled store (bounded poll), and surface the stray rejection instead of letting it escape as an unhandled error.

Activity

  1. added
    test-integrity
    severity:low
    on Nov 1, 2026
  2. abogartz commented on Nov 1, 2026

    @abogartz
    OwnerAuthor

    Another occurrence, same family: #248 attempt 1 on Windows, 7 fails in concurrency.test.ts + lifecycle-evidence.test.ts (all hook-timeout cascades; supersede racing inflated 550ms -> 5555ms by a slow worker), green on rerun of the same SHA.

    Concrete hardening this points at: Bun applies the default 5s timeout to beforeEach/afterEach hooks even when the test itself carries a longer override (the 30s on "a concurrent reader never sees a half-written file" does not protect its afterEach). Suggested fix (small PR): pass an explicit timeout to the hooks in test/concurrency.test.ts and test/lifecycle-evidence.test.ts (e.g. afterEach(fn, 30_000)), so a starved worker degrades to slow CI instead of red CI.

  3. abogartz commented on Nov 1, 2026

    @abogartz
    OwnerAuthor

    Root-caused, fixed (commit on refactor/tool-registry, ships with #247): the Windows-red family is Bun's 5s default test timeout vs genuinely slow work under --parallel=4 on Windows runners — process-spawning scenarios measured 5272ms green (prune sweep) and 4990ms (viewer mutation), so a slightly slower worker tips them over, Bun kills the racer children (racer-d1 exited null), and finish() rejects after teardown. Second half: hook timeouts stay at 5s even when the test carries a longer override — the lifecycle-evidence hook died at 8.3s next to its 30s test.

    The commit gives every test and hook in scenarios-consistency / concurrency / lifecycle-evidence an explicit 30s budget, no assertion changes. Remaining question for this issue: whether --parallel=4 should drop to 2 on Windows CI to reduce contention at the source — the budgets make the suite tolerant, not the runner less loaded.

  4. added
    agent:ready
    on Nov 3, 2026
  5. ocsi-triager commented on Nov 3, 2026

    @ocsi-triager

    osi-spec-hash: c502133b6bd90eb2 2026-11-03T22:01:46Z - acceptance criteria frozen at this text. A later edit to the body changes this hash, and the reviewer will withhold approval until a maintainer replies spec ok.

  6. added
    fix:working
    fix:pr-open
    and removed
    fix:working
    on Nov 3, 2026
  7. added a commit that references this issue on Nov 3, 2026
  8. abogartz-opencode-self-improvement commented on Nov 4, 2026

    @abogartz-opencode-self-improvement

    🎉 This issue has been resolved in version 0.15.20 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

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

    agent:readyfix:pr-openreleasedseverity:lowtest-integrity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions