docs: document jest suite load-flakiness and worktree test gotchas - #372
Open
RonenMars wants to merge 1 commit into
Open
docs: document jest suite load-flakiness and worktree test gotchas#372RonenMars wants to merge 1 commit into
RonenMars wants to merge 1 commit into
Conversation
…kip-ci] [skip-ci]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two testing gotchas cost real time during the 2026-07-22 integration snapshot and were only recorded in a throwaway snapshot branch.
This moves them somewhere durable.
Batch failures that aren't real — and the ones that are
The
SessionScreen.*suites each render the full session screen with fake timers, WebSocket stubs and long backstop timeouts.Jest's default parallel workers oversubscribe some machines, so a batch run reports failures that a single-suite run does not.
The trap runs in both directions, which is the part worth writing down.
During the snapshot, four genuinely broken suites were nearly dismissed as flakes on this basis, while two others really were load artifacts — and the batch output looked the same either way.
The rule is therefore not "use
--runInBand" but "never classify a batch failure without re-running that suite alone": passes alone means artifact, fails alone means real.Also lists the suites currently known to be load-sensitive, so they are not re-investigated from scratch.
npx jestfinds 0 tests in a worktree under.claude/testPathIgnorePatternsexcludes\.claude\, so every test path inside such a worktree is filtered out and scripts likenpm run test:i18nlook broken when they are not.Documents the fix (create worktrees outside
.claude/), the override for running in place, and the caveat that the override re-enables__tests__/unit/scripts/, which the main config excludes deliberately.Scope
Documentation only — no code, config or workflow changes.
docs/troubleshooting.mdgains a "Jest test suites" section matching the existing symptom / When / Cause / Fix format, andCLAUDE.mdgains a short rule pointing at it.