Flaky: missing-links.spec.ts:156 reads the old editor after “Create a new note” (chromium-1440, dev) #1118

Open
opened 2026-11-14 00:35:25 +00:00 by kayg · 1 comment
Owner

Found while unblocking #894. Per the flaky rule this does not block #894; it needs a stability fix on dev.

Repro (14 Nov, dev-01, --repeat-each=10 --workers=1 --retries=0, chromium-1440):

Tree Result
dev 796d80cba 1 failed / 9 passed (repeat 9)
#894 76e79ea8a (dev merged in) 10 / 10 passed

The first-run failure on #894 (c8bac8aee, full chromium-1440) had the same symptom.

Symptom: line 181, expect(getByRole('textbox', { name: 'Note text' })).toContainText(title) gets "-rukw1w. And more": the text of the linking note (see Old budget-rukw1w. And more. after Remove link), not the newly created note.

Likely cause: after the URL changes (line 180), the outgoing editor is still mounted during the pane transition, so the Note text locator resolves to it and the 5 s poll keeps reading the old note. Suggested fix: scope the assertion to the new note's pane (or wait for the old editor to detach / the new note's id in the editor root) before reading its text, rather than raising the timeout.

Logs: dev-01 ~/t894/dev/missing-links-r10.log (trace under the dev worktree's apps/web/test-results/…-repeat9/).

Found while unblocking #894. Per the flaky rule this does not block #894; it needs a stability fix on dev. **Repro (14 Nov, dev-01, `--repeat-each=10 --workers=1 --retries=0`, chromium-1440):** | Tree | Result | |---|---| | dev `796d80cba` | 1 failed / 9 passed (repeat 9) | | #894 `76e79ea8a` (dev merged in) | 10 / 10 passed | The first-run failure on #894 (`c8bac8aee`, full chromium-1440) had the same symptom. **Symptom:** line 181, `expect(getByRole('textbox', { name: 'Note text' })).toContainText(title)` gets `"-rukw1w. And more"`: the text of the *linking* note (`see Old budget-rukw1w. And more.` after Remove link), not the newly created note. **Likely cause:** after the URL changes (line 180), the outgoing editor is still mounted during the pane transition, so the `Note text` locator resolves to it and the 5 s poll keeps reading the old note. Suggested fix: scope the assertion to the new note's pane (or wait for the old editor to detach / the new note's id in the editor root) before reading its text, rather than raising the timeout. _Logs: dev-01 `~/t894/dev/missing-links-r10.log` (trace under the dev worktree's `apps/web/test-results/…-repeat9/`)._
Author
Owner

Stability lane (15 Nov), dev 42c219afd: not reproduced in 130 runs

e2e/missing-links.spec.ts:156, --workers=1 --retries=0 --repeat-each=30 on dev-01 chromium-1440 (load average ~23): 30 / 30 pass; dev-02 chromium-1440 30 / 30 and 40 / 40 (the first dev-02 batch showed 1 failed that was an ENOENT on my own parallel runs' shared test-results folder, not the spec); plus 250 / 250 in the #1178 gate (missing-links, links, link-states-quiet ×10 on chromium-1440 with the link-state fix). Reading the code: Editor.svelte show() clears the old text at once (editor.preview(text ?? "")) when the route's note changes, so the old note's text staying for 5 s means show() did not run for the new id, which I could not provoke. Not fixed.

## Stability lane (15 Nov), dev `42c219afd`: not reproduced in 130 runs `e2e/missing-links.spec.ts:156`, `--workers=1 --retries=0 --repeat-each=30` on dev-01 chromium-1440 (load average ~23): 30 / 30 pass; dev-02 chromium-1440 30 / 30 and 40 / 40 (the first dev-02 batch showed `1 failed` that was an `ENOENT` on my own parallel runs' shared `test-results` folder, not the spec); plus 250 / 250 in the #1178 gate (`missing-links`, `links`, `link-states-quiet` ×10 on chromium-1440 with the link-state fix). Reading the code: `Editor.svelte` `show()` clears the old text at once (`editor.preview(text ?? "")`) when the route's note changes, so the old note's text staying for 5 s means `show()` did not run for the new id, which I could not provoke. Not fixed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#1118
No description provided.