Skip to content

memory: file-lock test "keeps a lock held longer than staleMs fresh" is flaky on a slow runner #5680

Done

Description

@cliffhall

Problem

src/memory/__tests__/file-lock.test.ts › withFileLock › "keeps a lock held longer than staleMs fresh, so it is not broken" fails intermittently. It expects the event order [long start, long end, waiter] and sometimes gets [long start, waiter, long end], i.e. the waiter acquired the lock while the long holder still held it.

Where it has been seen

Expected

Either the lock's heartbeat keeps a long-held lock fresh on a slow runner, or the test's timing does not depend on scheduler luck. AGENTS.md forbids test retries, so the fix is to make the test (or the heartbeat) deterministic, not to retry it. Related earlier fix of a sibling race in the same file: #5634.

Acceptance

The test passes deterministically under load (e.g. a loop of the file under --sequence.concurrent / CPU contention) and in CI.

Activity

  1. added this to the v2.7.0 milestone on Nov 27, 2026
  2. added
    bug
    server-memory
    on Nov 27, 2026
  3. self-assigned this
    on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugserver-memoryv2

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions