Skip to content

test: snapshot concurrent save tests fail locally on main #1117

@carlos-alm

Description

@carlos-alm

Two snapshot tests fail consistently when run locally (npx vitest run tests/unit/snapshot.test.ts) on main (commit 6ef7dc6 and later):

  • tests/unit/snapshot.test.ts > snapshotSave > does not corrupt output when two --force saves race on the same name
  • tests/unit/snapshot.test.ts > snapshotSave > atomically rejects a concurrent non-force save when one already won

Both assert expect(fulfilled).toHaveLength(2) but get 0 — both concurrent save promises reject instead of one fulfilling.

Likely a race-related flake introduced or exposed by #1003 (TOCTOU close fix). Worth investigating whether something in the lock/lease handling is over-restrictive or platform-sensitive (macOS file system).

Surfaced while sweeping PR #1107; not caused by that PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions