test: centralize vitest testTimeout so packages can't inherit the 5s default #78
No reviewers
Labels
No labels
dependencies
major
security-pin
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
trails-cool/trails!78
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/centralize-vitest-timeout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Renovate PRs keep going red for reasons unrelated to the dependency they bump. #75 is a pure lockfile bump (esbuild 0.28.1 → 0.28.2) and its only CI failure is
packages/fit'sgpx-to-fit-coursetest timing out at 5000ms — something a bundler patch release cannot cause.The cost is one-time module loading, not test work.
parseGpxAsynclazilyawait import("linkedom")and caches the parser in_LinkedDOMParser, so the whole import lands on whichever test runs first. That is why the smallest fixture is the one that fails:A 20× penalty on iteration one only. Locally 61ms is invisible; on a contended runner the same one-time cost crosses 5s.
This was already fixed three times, once per package
Each as
--testTimeout=20000in apackage.jsontest script, each after a renovate PR went red:ee19578packages/db805ac86packages/gpxf31eb26apps/journalpackages/fitnever got the flag and stayed at the 5s default — even though805ac86was prompted by the gpx→fit round-trip, i.e. the same code pathpackages/fittests. A fourth per-package flag just moves the whack-a-mole along.So set it once in
vitest.shared.ts, which every package'svitest.config.tsextends, and drop the three scattered copies. A new package can no longer be born at the 5s default and rediscover this.Also set in the root
vitest.config.ts: that file does not extend the shared one and is whatpnpm test:watchuses, so without it watch mode sits at 5s while CI is at 20s — the same divergence pointing the other way.Testing
Verified the mechanism rather than assuming it:
--testTimeout=30(short-flat needs 61ms, the others 3ms) yields1 failed | 7 passed (8)with short-flat as the failure — the same shape as run 638. Confirms the timeout is the binding constraint and nothing else is wrong.packages/fit. Removed afterwards.db,gpxandjournalfrom the shared config alone.renovate/esbuild-=0.27.3-0.28.1-0.x, installed its lockfile (esbuild 0.28.2 confirmed present), and ran the previously-failing test — 8/8 passed. Full suite on that branch: test 12/12, typecheck 14/14, lint 14/14, build 2/2.What this does not fix
runs-on: playwrightresolves to a runner-pinned image. When renovate bumps the@playwright/testpackage past it, visual tests die with:Confirmed on #66 (job ran
image=mcr.microsoft.com/playwright:v1.61.1-noble, PR installsplaywright 1.62.1). Renovate can never make such a PR green while the image version lives in runner config and the package version inpackage.json— which is what #62 is probing. #66 needs both that and this.After this lands, #75 should go green on a rebase. #66 needs #62 as well.