Skip to content

[ci] Benchmark preflight + fail-fast for broken deployments#2846

Merged
VaguelySerious merged 1 commit into
mainfrom
peter/benchmark-preflight
Jul 9, 2026
Merged

[ci] Benchmark preflight + fail-fast for broken deployments#2846
VaguelySerious merged 1 commit into
mainfrom
peter/benchmark-preflight

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

The first production baseline runs from #2842's push: main trigger failed pathologically: every stream read timed out at the 120s guard, both stream scenarios ran out their 30-minute vitest timeouts, and the job died at its 60-minute limit with no useful error (runs 28981485638, 28983634194). Notably, the e2e Vercel Prod lane passed on main ~20 minutes earlier with the same client code, so this looks specific to how the benchmark runs behave against the production deployment — but the logs can't currently tell what is stuck.

Three changes make this failure mode cheap and self-diagnosing:

  • Preflight: before any scenario spends its attempt budget, a trivial 1-step run must complete within 3 minutes (BENCH_PREFLIGHT_TIMEOUT_MS). If it doesn't, all scenarios abort immediately with a clear "deployment accepted the run but did not execute it to completion" error. Worst-case job time for a broken target drops from 60+ minutes to ~5.
  • Zero-success circuit breaker: a scenario aborts after 3 attempts with zero successful iterations (systematic breakage) instead of draining its full retry budget at 2 minutes per attempt. Normal flake-retry behavior after the first success is unchanged.
  • Run-state probe on stream timeouts: the error now reports whether the run completed, is still not finished, or failed — distinguishing "queue never delivered the run" from "run finished but chunks never became visible to the reader". The next production run's logs will answer which one we're hitting.

Verified locally: preflight failure aborts the whole file in seconds with all scenarios skipped; typecheck and lint clean.

The first production benchmark runs (push: main baselines) failed with
every stream read timing out at 120s, burning the full 60-minute job
timeout without a useful error. Three changes make that mode cheap and
diagnosable:

- Preflight: a trivial 1-step run must complete within 3 minutes before
  any scenario runs; otherwise all scenarios abort immediately with a
  clear "deployment accepted the run but did not execute it" error.
- Zero-success circuit breaker: a scenario aborts after 3 attempts with
  no successful iterations instead of draining its full retry budget.
- Stream-read timeouts now probe and report the run state (completed /
  still not finished / failed), distinguishing "run never executed"
  from "read path broken".
@VaguelySerious VaguelySerious requested review from a team and ijjk as code owners July 9, 2026 00:14
@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview, Comment Jul 9, 2026 12:18am
example-nextjs-workflow-webpack Ready Ready Preview, Comment Jul 9, 2026 12:18am
example-workflow Ready Ready Preview, Comment Jul 9, 2026 12:18am
workbench-astro-workflow Ready Ready Preview, Comment Jul 9, 2026 12:18am
workbench-express-workflow Ready Ready Preview, Comment Jul 9, 2026 12:18am
workbench-fastify-workflow Ready Ready Preview, Comment Jul 9, 2026 12:18am
workbench-hono-workflow Ready Ready Preview, Comment Jul 9, 2026 12:18am
workbench-nitro-workflow Ready Ready Preview, Comment Jul 9, 2026 12:18am
workbench-nuxt-workflow Ready Ready Preview, Comment Jul 9, 2026 12:18am
workbench-sveltekit-workflow Ready Ready Preview, Comment Jul 9, 2026 12:18am
workbench-tanstack-start-workflow Ready Ready Preview, Comment Jul 9, 2026 12:18am
workbench-vite-workflow Ready Ready Preview, Comment Jul 9, 2026 12:18am
workflow-docs Ready Ready Preview, Comment, Open in v0 Jul 9, 2026 12:18am
workflow-swc-playground Ready Ready Preview, Comment Jul 9, 2026 12:18am
workflow-tarballs Ready Ready Preview, Comment Jul 9, 2026 12:18am
workflow-web Ready Ready Preview, Comment Jul 9, 2026 12:18am

@changeset-bot

changeset-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 190824d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

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

Not sure what this means? Click here to learn what changesets are.

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

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 1453 0 230 1683
✅ 💻 Local Development 1617 0 219 1836
✅ 📦 Local Production 1617 0 219 1836
✅ 🐘 Local Postgres 1617 0 219 1836
✅ 🪟 Windows 153 0 0 153
✅ 📋 Other 894 0 177 1071
Total 7351 0 1064 8415

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 126 0 27
✅ example 126 0 27
✅ express 126 0 27
✅ fastify 126 0 27
✅ hono 126 0 27
✅ nextjs-turbopack 150 0 3
✅ nextjs-webpack 150 0 3
✅ nitro 126 0 27
✅ nuxt 126 0 27
✅ sveltekit 145 0 8
✅ vite 126 0 27
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 128 0 25
✅ express-stable 128 0 25
✅ fastify-stable 128 0 25
✅ hono-stable 128 0 25
✅ nextjs-turbopack-canary 134 0 19
✅ nextjs-turbopack-stable 153 0 0
✅ nextjs-webpack-canary 134 0 19
✅ nextjs-webpack-stable 153 0 0
✅ nitro-stable 128 0 25
✅ nuxt-stable 128 0 25
✅ sveltekit-stable 147 0 6
✅ vite-stable 128 0 25
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 128 0 25
✅ express-stable 128 0 25
✅ fastify-stable 128 0 25
✅ hono-stable 128 0 25
✅ nextjs-turbopack-canary 134 0 19
✅ nextjs-turbopack-stable 153 0 0
✅ nextjs-webpack-canary 134 0 19
✅ nextjs-webpack-stable 153 0 0
✅ nitro-stable 128 0 25
✅ nuxt-stable 128 0 25
✅ sveltekit-stable 147 0 6
✅ vite-stable 128 0 25
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 128 0 25
✅ express-stable 128 0 25
✅ fastify-stable 128 0 25
✅ hono-stable 128 0 25
✅ nextjs-turbopack-canary 134 0 19
✅ nextjs-turbopack-stable 153 0 0
✅ nextjs-webpack-canary 134 0 19
✅ nextjs-webpack-stable 153 0 0
✅ nitro-stable 128 0 25
✅ nuxt-stable 128 0 25
✅ sveltekit-stable 147 0 6
✅ vite-stable 128 0 25
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 153 0 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 128 0 25
✅ e2e-local-dev-tanstack-start- 128 0 25
✅ e2e-local-postgres-nest-stable 128 0 25
✅ e2e-local-postgres-tanstack-start- 128 0 25
✅ e2e-local-prod-nest-stable 128 0 25
✅ e2e-local-prod-tanstack-start- 128 0 25
✅ e2e-vercel-prod-tanstack-start 126 0 27

📋 View full workflow run

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

📊 Workflow Benchmarks

commit 190824d · Thu, 09 Jul 2026 00:35:01 GMT · run logs

Backend: vercel · app: nextjs-turbopack

Metric Scenario Avg (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS stream 1340 1631 🔴 1658 🔴 2131 🔴 30
TTFS hook + stream 1561 1850 🔴 2028 🔴 2113 🔴 30
STSO 1020 steps (1-20) 284 335 🔴 480 🔴 595 🔴 19
STSO 1020 steps (101-120) 400 461 🔴 539 🔴 546 🔴 19
STSO 1020 steps (1001-1020) 1003 860 🔴 1064 🔴 4292 🔴 19
WO stream 1340 1631 1658 2131 30
WO hook + stream 1561 1850 2028 2113 30
SL stream 4530 5054 🔴 5606 🔴 5853 🔴 30
SL hook + stream 4777 5312 🔴 5488 🔴 5777 🔴 30

Metrics — TTFS: time to first step body execution · STSO: step-to-step overhead (gap between consecutive step bodies) · WO: workflow overhead (time outside step bodies, client start → last step body exit) · SL: stream latency (first chunk write → visible to the reader)

Scenarios — stream: one step that streams chunks back to the client; no hooks, so the run stays in turbo mode · hook + stream: registers a hook before the same streaming step, which exits turbo mode · 1020 steps: 1020 trivial sequential steps; STSO is measured between consecutive steps in the given step ranges

🟢/🔴 mark percentiles within/above target. Targets (p75/p90/p99, ms) — TTFS 200/300/600 · SL 50/60/125 · STSO (1-20) 20/30/60 · STSO (101-120) 30/45/90 · STSO (1001-1020) 40/60/120

TTFS/WO compare client vs deployment clocks and SL compares the step runner’s clock vs the client’s (NTP-synced in CI). WO ends at the last step body exit, the closest observable proxy for the final step-completion request.

@VaguelySerious VaguelySerious merged commit 39673b7 into main Jul 9, 2026
103 checks passed
@VaguelySerious VaguelySerious deleted the peter/benchmark-preflight branch July 9, 2026 00:53
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

No backport to stable for 39673b7 (AI decision).

This commit only modifies packages/core/e2e/benchmark.test.ts, which does not exist on stable (verified via git ls-tree origin/stable — stable has a different bench.bench.ts instead), plus an empty changeset. The preflight/fail-fast improvements build on a benchmark harness that is main-only, so there is nothing to backport.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

39673b7a381b029032525485e566f1663f549fa3

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.

1 participant