Test fix: PrepSheet's Shelf test looks its section up inside the wait (#955) #956

Merged
claude-bot merged 1 commit from fix/prepsheet-shelf-flake into main 2026-09-30 07:25:12 +00:00
Collaborator

Closes #955. It's flaked twice in one night:

Both were "Frontend (shard 2/2)", both at PrepSheet.test.jsx:519, and both were Expected container to be an Element … but got null.

The cause: the test captured shelf = heading.closest("section") once, before its waitFor. Under load the heading can be found in a render where it isn't in its <section> yet, so shelf stayed null, and the waitFor spun on it until it timed out (5 s).

The fix: find the heading first as before, then look the section up inside the waitFor and assert it's there, so the wait covers the heading landing in its section too. It's test-only.

Checks: eslint shows 0 errors, and PrepSheet.test.jsx passed 5 runs in a row (25/25 each).

🤖 Generated with Claude Code

Closes #955. **It's flaked twice in one night:** - #949's run 1669; - #953's run 1674. Both were "Frontend (shard 2/2)", both at `PrepSheet.test.jsx:519`, and both were `Expected container to be an Element … but got null`. **The cause:** the test captured `shelf = heading.closest("section")` once, before its `waitFor`. Under load the heading can be found in a render where it isn't in its `<section>` yet, so `shelf` stayed `null`, and the `waitFor` spun on it until it timed out (5 s). **The fix:** find the heading first as before, then look the section up **inside** the `waitFor` and assert it's there, so the wait covers the heading landing in its section too. It's test-only. **Checks:** eslint shows 0 errors, and `PrepSheet.test.jsx` passed **5 runs in a row** (25/25 each). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
test(prep): look the Shelf section up inside the wait, not before it (#955)
All checks were successful
CI / Backend lint (ruff) (pull_request) Successful in 40s
CI / Bot/backend version sync (pull_request) Successful in 30s
CI / Feedback site tests (pull_request) Successful in 59s
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 59s
CI / Does this change touch the recording path? (pull_request) Successful in 30s
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Has been skipped
CI / Bot tests and audit (pull_request) Successful in 2m3s
CI / Docker image build (pull_request) Successful in 1m46s
CI / Frontend (shard 1/2) (pull_request) Successful in 8m17s
CI / End-to-end journeys (phone) (pull_request) Successful in 8m32s
CI / End-to-end journeys (keyboard) (pull_request) Successful in 9m7s
CI / End-to-end journeys (desktop) (pull_request) Successful in 9m21s
CI / Frontend (shard 2/2) (pull_request) Successful in 15m37s
CI / Backend migration, tests, and audit (pull_request) Successful in 45m30s
867c131271
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign in to join this conversation.
No description provided.