Skip to content

Serial brain durability hook test can fail on stale temp git index.lock #189

Description

@100yenadmin

TLDR

The serial-tests CI job has repeatedly failed in test/brain-durability-hook.serial.test.ts because a temp git repo contains .git/index.lock when the test tries to run git add orphan.md. This is a CI/test isolation flake, not a product failure.

Evidence

fatal: Unable to create '/tmp/bdh-.../work-.../.git/index.lock': File exists.
(fail) post-commit hook (D9 local, D7 self-contained) > logs a clear LOCAL-ONLY line when origin is unreachable

Observed on both PR #186 and PR #188 serial runs.

Expected behavior

The serial test should create/use a temp Git repo in a way that cannot inherit or race on stale index locks. If a lock exists during setup, the test should clean it before its own deterministic git add step, or isolate the hook setup so no overlapping git process remains.

Acceptance criteria

  • Serial test no longer flakes on .git/index.lock in temp repo setup.
  • Product code behavior remains unchanged.
  • PR CI serial-tests pass without manual reruns.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions