chore: prevent cursor carryover between preload test phases - #16510
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/9d42896474c8381f13952d86477ec71fc5fb7829Open in Note This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed. |
|
Rich-Harris
left a comment
There was a problem hiding this comment.
ah, this is great! we've been meaning to set up an agent loop to tackle these flaky tests as they arise, but it never rises all the way to the top of the pile
data-sveltekit-preload-datafails intermittently under server-side route resolution, about 1 in 6 locally onversion-3, and anything that shifts hydration timing makes it worse (a one-line import change on #16308 took it to 3 failed retries in CI).The test navigates between phases with the cursor still parked over the previous phase's link. When the fresh page hydrates, Chromium fires a mouse event at that position and the router preloads that link's target, so the phase that expects zero requests counts a preload it never triggered. A request timeline shows the target's
__route.js, node script and__data.jsonall arriving before the phase'sgotoresolves, ahead of any hover.Parking the mouse before each navigation removes the carryover. 10 of 10 runs green under
ROUTER_RESOLUTION=serverwith the change.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits