Skip to content

#14: de-flake baseline generate is deterministic#30

Merged
devill merged 1 commit into
mainfrom
issue-14-deflake-deterministic
Jun 17, 2026
Merged

#14: de-flake baseline generate is deterministic#30
devill merged 1 commit into
mainfrom
issue-14-deflake-deterministic

Conversation

@devill

@devill devill commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Closes #14.

Root cause

The test ran two full baselineGenerate passes, each spawning eslint. The wrap layer is fail-soft — a slow/failed spawn under CI load surfaces as zero violations — so the two passes could record different violation sets and the byte-identical assertion failed intermittently (Linux/CI only).

Fix (locked decision — option a)

Assert serialization determinism over a fixed/injected violation set: drive saveBaseline directly with stubbed violations in two different insertion orders and assert the written files are byte-identical. This verifies exactly what the test name claims — deterministic serialization (the sortedEntries sort in store.ts) — with no live multi-process spawns.

No distinct coverage is lost: entry population, per-file recording, and merge-with-existing behaviour remain covered by the sibling tests in the same describe block. Ran the new test 5× — green every time.

Atomic commits

  • #14: de-flake baseline determinism test with a fixed violation set

Gates

  • pnpm build, pnpm lint — clean
  • pnpm test — 385 passed

🤖 Generated with Claude Code


Generated by Claude Code

Replace the two live baselineGenerate runs (which spawn eslint and can
return different violation sets under CI load via the fail-soft path)
with a direct saveBaseline call over a stubbed violation set in two
insertion orders. Asserts byte-identical serialization — exactly what
the test name claims — with no multi-process spawns.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nq6xHU6JtSNpYWhMYjXB15
@devill
devill marked this pull request as ready for review June 17, 2026 14:37
@devill
devill merged commit 5f2334b into main Jun 17, 2026
2 checks passed
@devill
devill deleted the issue-14-deflake-deterministic branch June 19, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test: baseline generate > is deterministic fails intermittently under CI load

2 participants