test(bindx): fix the chronic author-select flake, capture failure screenshots, cover collectFieldsData - #90
Open
matej21 wants to merge 2 commits into
Open
test(bindx): fix the chronic author-select flake, capture failure screenshots, cover collectFieldsData#90matej21 wants to merge 2 commits into
matej21 wants to merge 2 commits into
Conversation
`collectFieldsData` is the other public way into relation collection, and it reaches `collectHasOneOperation` the same way `collectUpdateData` does — so it walks a hasOne cycle and, without the in-progress guard, overflows the stack. It had no coverage because nothing in the persist pipeline routes through it: a fields-scoped persist uses BatchPersister's own scalar-only variant instead. Refs #88 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EmqgPtZvAfpvWKymfFZCEX
`Article with Author Select > changing author enables save` failed on roughly half of all CI attempts since 2026-08-20, on branches with nothing to do with it. The popover was opened once, outside the retry loop. A click that lands while the option list is remounting is lost *and* dismisses the popover, so every remaining `clickUntil` attempt found no option to click: the whole budget burned without a single real try, and the test spent 15s waiting for an outcome nothing could produce. Open the popover inside the retry callback instead, and only when the option is not already there — so a dismissed popover is reopened rather than toggled shut. Also make `waitFor` screenshot the page when it times out. CI has always uploaded `/tmp/browser-test-*.png` on failure, but nothing ever wrote one, so the artifact was empty on every red run. `clickUntil` opts out for its intermediate polls, which are expected to fail and retry. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EmqgPtZvAfpvWKymfFZCEX
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 test-only changes.
The chronic browser flake
Article with Author Select > changing author enables save and updates displayhas failed on roughly half of all CI attempts since 2026-08-20, on branches that touch nothing near it — 10 of 18 attempts in one sweep on 2026-08-24, and again today on the merge commit for #89. It has been reading as a regression signal on unrelated PRs.The popover was opened once, outside the
clickUntilretry loop:A click that lands while the option list is remounting is lost and dismisses the popover. From then on
janeOption()does not exist, so every remaining attempt throws inside the target callback (swallowed by design) and settles for nothing. The budget burns without a single real try — which is why the failure always costs the full ~15s and why raising the budget would not have helped.Now the popover is opened inside the retry callback, and only when the option is not already present, so a dismissed popover is reopened instead of toggled shut.
Screenshots on failure
ci.ymlhas always uploaded/tmp/browser-test-*.pngon failure, but nothing in the harness ever calledscreenshot()— the artifact was empty on every red run, which is part of why this flake stayed unexplained for a week.waitFornow captures on timeout;clickUntilpassescapture: falsefor the intermediate polls it expects to fail and retry.collectFieldsDatacycle coverageFollow-up to #88.
collectFieldsDatais the other public entry into relation collection and reachescollectHasOneOperationexactly ascollectUpdateDatadoes, so it walks a hasOne cycle and — without the guard from #89 — overflows the stack. It had no coverage because nothing in the persist pipeline routes through it: a fields-scoped persist usesBatchPersister's own scalar-only variant instead. Verified the new case fails with theRangeErrorwhen the guard is reverted.Verification
bun run test:browserlocally: 66 pass / 0 fail; the author-select file alone drops from ~15s worst case to 4s/tmp/browser-test-<ts>.pngand named it in the errorbun test tests/unit/persistence/relationCycleCollection.test.ts: 4 pass; the new case fails withRangeErroragainst the pre-fix(bindx): stop nested collection recursing through relation cycles #89 collectorNote for a follow-up, not changed here:
MutationCollector.collectFieldsDatahas no caller anywhere in the monorepo.🤖 Generated with Claude Code
https://claude.ai/code/session_01EmqgPtZvAfpvWKymfFZCEX