You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 26b6194
Browse filesBrowse the repository at this point in the historyBrowse files
fix(router): dev PPR capture backoff cap, cf-basic ppr warmup + CI budget, snapshot-test flake (#652 item 3) (#659)
Four coordinated changes unblocking cloudflare-basic-e2e on cold CI runners
(failures on the main run for 2586ea9, the PR #657 runs, and PR #659's own
first CI run):
1. Dev backoff cap (runtime). The refused-capture backoff window is exponential
per consecutive failure, `min(BASE * 2^(failures-1), ceiling)`; the ceiling was a
flat 60s in every mode. On a cold runner each cold re-probe climbs the count, and
once the window exceeds ~16s it outlasts warmToHit's 20s poll: every request is
skipped as backed-off, an eternal MISS. The ceiling is now mode-dependent: 60s in
production (a genuinely ineligible route should be re-probed rarely), ~2s in dev,
where the dominant no-shell cause is a cold module graph that warms on the very
attempt that failed. Dev signal is `process.env.NODE_ENV !== "production"`,
matching handler.ts / server-action.ts / progressive-enhancement.ts.
2. PPR dev warmup (test-side, the sufficient fix). PR #659's first CI run showed
the cap alone is not sufficient: one probe cycle is ~12s (5s attempt + 5s in-place
retry + 2s capped backoff), so the 20s window fits ~2 cycles and today's cold
runners need more because the dev module graph is compiled ON DEMAND during the
capture render, repeatedly blowing the 5s budget (physics hole failed 3x at ~20s).
Extend tests/cloudflare-basic's existing dev-warmup setup project (which the dev
project already depends on) with a ppr warmup: GET every ppr fixture route under
an isolated `?probe=warmup` shell key (module-graph warm only, no test-visible
entry pre-stored), then poll each capturable fixture to x-rango-shell HIT, proving
the full capture pipeline (Flight render, fizz prerender+abort, putShell) is hot
before any real test's warm window starts. Cap + warmup together: the warmup makes
first attempts succeed; the cap remains the safety net for anything cold the
warmup missed. warmToHit windows and runtime constants are otherwise untouched.
3. CI budget (the 600s owner). cloudflare-basic's playwright globalTimeout was
`10 * 60 * 1000` on CI; the merged PPR stack grew the sequential dev ->
production -> hmr run past 10m, so healthy runs brushed the cap and any flake
retry tipped it over — Playwright killed the run mid-flight ("Timed out waiting
600s for the test suite to run"), failing whichever test was executing (the 0ms
hmr-warmup skip-cascade, the mid-hmr kill at 10:31:06 while hmr tests were
passing). Raised to 14m, and the cloudflare-basic-e2e job's timeout-minutes from
15 to 20 so the workflow cap contains ~3-4m setup + the 14m playwright budget.
vite-rsc-demo and rangojs-router keep their 600s globalTimeout: their jobs
shard/split, and recent CI runs show per-job playwright time of ~3-5m — nowhere
near the cap.
4. shell-snapshot.test.ts 1ms flake (also blocking CI). "serves snapshot values
AS FRESH" builds the seeded store and the expected value from two separate
snapshotOf() calls, and segData embeds `Date.now() + 60_000` as expiresAt — a
millisecond tick between the calls fails the deep-equal (seen on the #659 run).
Pin the clock with fake timers (the shell-cache.test.ts pattern). The rest of the
file was audited: no other assertion deep-equals across two Date.now() instants.
Production backoff ceiling/growth, retry-in-place, the in-flight set, and the e2e
warm-window lengths are unchanged. #652 items 1-2 (barrier narrowing, drain
unification) remain open.
0 commit comments