Skip to content

chore: faster CI - #16842

Merged
Rich-Harris merged 5 commits into
version-3from
faster-tests
Aug 20, 2026
Merged

Rich-Harris merged 5 commits into
version-3from
faster-tests

Conversation

@Rich-Harris

Copy link
Copy Markdown
Member

I have a hunch that there are several things we can be doing to improve the time it takes to run CI. I asked an agent to find the lowest-hanging fruit and this is what it came up with — mostly enabling more parallelism, though it did also remove Node 22 from the e2e test matrix, which is possibly dangerous. Let's see how much this buys us

@pkg-svelte-dev

pkg-svelte-dev Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from 19841f6:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/19841f6bb7ad058aa0d6bb5bf6c078a27be0ce67

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/kit/pr/16842

@changeset-bot

changeset-bot Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 19841f6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@svelte-docs-bot

Copy link
Copy Markdown

@teemingc

teemingc commented Aug 18, 2026 •

Copy link
Copy Markdown
Member

There's also a setting for '50%' workers, etc. to adjust to the number of cores the runner has rather than a strict number

I also suspect there may be some tests we're running in multiple suites which we can deduplicate but I haven't looked deeply into it.

Removing Node 22 for test-kit probably frees up a good number of runners. Those are currently the longest tests

Stacked on #16842.

The e2e legs were six copies of the same job with different scripts
wired in. They're now one `e2e` matrix (rows are `{ script, project,
shard, os, browser, workers }`) and one `test` matrix for unit tests,
which also gives kit's unit tests a Windows leg outside
`test:cross-platform:dev`. `basics` runs its js project in two shards
and its no-js project alone (`KIT_E2E_SHARD`, `KIT_E2E_PROJECT` in
`test/utils.js`); Playwright shards by contiguous test count, so a shard
straddling the two projects was the 7m/1m40 split.

Longest job 14m → 6.5m, coverage and runner-minutes unchanged. 88% of
kit runs share the org's 60-slot pool with another kit run, so cutting
runner-minutes means dropping cells, which is a separate decision.
Rich-Harris pushed a commit that referenced this pull request Aug 20, 2026
#16852)

`_invalidate` in `packages/kit/src/runtime/client/client.js` detects a
racing navigation by capturing `is_navigating` and bailing if it flipped
back to false. But `navigate` sets `is_navigating` only after `await
get_navigation_intent(url, false)`, which is a network round trip when
route resolution happens on the server. An `invalidate()` or
`refreshAll()` starting during that round trip sees `is_navigating ===
false`, reruns the load functions of the page being left, and applies
their result over the page the navigation just rendered.

A navigation makes an in-flight invalidation stale exactly when it
applies its result, which is also when it reassigns `current`, so
`_invalidate` now captures `current` and bails if its identity changed.

The existing test only hits the race when route resolution outlasts its
50ms `refreshAll` timer, so it passes locally and fails on loaded CI
runners. It now delays `__route.js` responses by 150ms, and fails
without the fix.

This is what turns the `test:server-side-route-resolution` legs red on
#16842.

@teemingc teemingc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I think the longest one takes 7 mins now. Don't love the job names but I'm not sure how to improve them yet.

@Rich-Harris
Rich-Harris merged commit 3ae5f22 into version-3 Aug 20, 2026
40 checks passed
@Rich-Harris
Rich-Harris deleted the faster-tests branch August 20, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants