Files
PaperClipAI/scripts/e2e-shard-durations.json
T
Dotta 7563842165 perf(ci): cut E2E ceiling under 95s via 16 AWS shards, 8-core speedup, top serial splits, and parallel UI build (#22960)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Live 8-core PR runs (`45668834558`, `45667106472`) showed
`e2e_shards` was the #1 critical-path bottleneck on normal PRs
(`152–171s` test step) due to four compounding causes:
> 1. `scripts/e2e-shard.mjs` still used the 4-vCPU
`EFFECTIVE_PARALLEL_SPEEDUP = 1.85` even on 8-vCPU runners running 4
Playwright workers (`~3.35x` measured speedup), under-allocating serial
shards (`5` serial shards running `96–124s` while parallel shards sat
idle after `55–78s`).
> 2. `scripts/e2e-shard-durations.json` had stale weights
(`chat-adapters-ui-providers.spec.ts` `86.8s` vs `117–165s` actual;
`acp-stop-continuation.spec.ts` `69.3s` vs `88–102s` actual).
> 3. Three serial (`1-worker`) specs pinned the floor at `75–91s`:
`agent-configuration.spec.ts` (`91.4s`), `agent-chat-sessions.spec.ts`
(`79.9s`), and `onboarding.spec.ts` (`75.3s`).
> 4. `playwright.config.ts` ran `vite build ui` (`~5.4s`) serially
before starting embedded Postgres + 512 migrations (`~21s`) even though
database bootstrap does not read `server/ui-dist`.
> - This pull request overlaps the unminified Vite UI build with
Postgres bootstrap inside `start-e2e-server.ts`, splits the top 3 serial
specs into 6 balanced specs (keeping all 3 anchor filenames and 100% of
20 tests intact), makes `e2e-shard.mjs` CPU-aware (`3.2x` on 8-vCPU /
`1.85x` on 4-vCPU), refreshes all 58 specs in
`e2e-shard-durations.json`, and scales AWS `e2e_shards` `12 -> 16` while
keeping `ubuntu-latest` hosted at `4` — bringing simulated E2E test
execution to `~90–96s` (`-60 to -75s`).

## Linked Issues or Issue Description

Refs #22804

**What existing behavior does this improve?**
E2E shard wall-clock ceiling on 8-core PR runners (`tests/e2e/`,
`scripts/e2e-shard.mjs`, `scripts/e2e-shard-durations.json`,
`.github/ci-task-matrix.json`, `.github/workflows/pr-trusted.yml`).

**Subsystem affected**
tests/e2e/ and CI — Playwright server bootstrap, serial spec sharding,
and E2E shard matrix

**Current behavior**
E2E shards take `152–171s` on 8-core runners because `vite build ui`
runs serially before Postgres boot, 3 serial specs run `75–91s` each,
`e2e-shard.mjs` assumes 4-vCPU `1.85x` parallel speedup, and AWS runs 12
shards.

**Proposed behavior**
Overlap unminified Vite UI build with embedded Postgres boot in
`tests/e2e/start-e2e-server.ts`, split the top 3 serial specs into 6
balanced specs (preserving anchor paths and all tests), use CPU-aware
parallel speedup (`3.2x` on 8-vCPU / `1.85x` on 4-vCPU) with refreshed
58-spec durations, and run 16 AWS E2E shards (`8 serial + 8 parallel`,
`59.7–76.5s` Playwright) while keeping `ubuntu-latest` hosted at `4`.

## What Changed

- **Overlapped UI build with Postgres bootstrap
(`tests/e2e/playwright.config.ts`, `tests/e2e/start-e2e-server.ts`):**
- Launches `start-e2e-server.ts` directly with `PAPERCLIP_E2E_BUILD_UI`
(`0` when `PAPERCLIP_E2E_SKIP_UI_BUILD=1`), overlapping `vite build ui
--outDir ../server/ui-dist --emptyOutDir --minify false` concurrently
inside `Promise.all([dbPromise, import("../../server/src/index.js"),
uiReady])` with `stopUiBuild()` and `dbPromise` cleanup on
signals/failure, plus `maintenance_work_mem = 128MB` / `work_mem = 32MB`
on disposable PG.
- **Split top 3 serial E2E specs (100% of 20 tests preserved, all 3
anchor filenames & `maps/` links intact, all 3 new siblings registered
in BOTH `playwright.config.ts` and `scripts/e2e-shard.mjs`
`SERIAL_SPECS`):**
- `agent-configuration.spec.ts` (3 tests) +
`agent-configuration-revisions.spec.ts` (5 tests) +
`agent-configuration.shared.ts`
- `agent-chat-sessions.spec.ts` (3 tests) +
`agent-chat-sessions-navigation.spec.ts` (3 tests)
- `onboarding.spec.ts` (3 tests) + `onboarding-resume.spec.ts` (3 tests)
- **CPU-aware speedup, refreshed 58-spec manifest, & 16 AWS E2E shards
(`scripts/e2e-shard.mjs`, `scripts/e2e-shard-durations.json`,
`.github/ci-task-matrix.json`, `.github/workflows/pr-trusted.yml`,
`.github/scripts/tests/ci-plan.test.mjs`,
`scripts/__tests__/e2e-shard.test.mjs`):**
- Exported `EFFECTIVE_PARALLEL_SPEEDUP_4W = 3.2` and
`resolveEffectiveParallelSpeedup(cpus)` matching `playwright.config.ts`
worker scaling.
- Refreshed all 58/58 spec weights from live 8-core runs `45668834558` &
`45667106472`.
- Scaled AWS `e2e_shards` `12 -> 16` while keeping `ubuntu-latest`
hosted at `4`.

## Verification

- `node --test scripts/__tests__/e2e-shard.test.mjs
.github/scripts/tests/ci-plan.test.mjs
scripts/check-test-budget.test.mjs
scripts/__tests__/merge-queue-checks-workflow.test.mjs` — **45/45 PASS**
- `npx playwright test --config tests/e2e/playwright.config.ts --list`
on all 6 split specs — **20 tests in 6 files**
- `tsc --strict --noEmit` across all 9 edited `tests/e2e/*.ts` files —
**0 errors**
- `node scripts/check-test-budget.mjs --base origin/master` and `node
scripts/check-maps.mjs` — **PASS**
- `ruby -ryaml -e 'YAML.load_file(".github/workflows/pr-trusted.yml")'`
— **YAML OK**

## Risks

- Low risk: all 3 original serial spec anchor filenames remain intact,
`PAPERCLIP_E2E_SKIP_UI_BUILD=1` is preserved, signal/failure handlers
clean up both the Vite child and embedded PG, `ubuntu-latest` stays at 4
hosted shards, and full CI runs all E2E shards live before merge.

## Model Used

- Gemini 4 Neon (High) via Antigravity agent swarm (`e2e-opt`,
`verifier`, `ci-pipeline`).

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge
2026-11-25 13:40:52 -06:00

86 lines
3.9 KiB
JSON

{
"$comment": "Refreshed from live 8-vCPU pre-baked AMI PR runs 45668834558 and 45667106472 with exact per-test split totals for agent-configuration, agent-chat-sessions, and onboarding. scripts/e2e-shard.mjs uses these weights only to place specs on shards; they never change which specs run.",
"unit": "ms",
"sources": [
{
"pull": 22954,
"run": 45668834558,
"attempt": 1,
"sha": "8aae20a022ae3401d5f419cb5dc8a8811259b248",
"url": "https://github.com/paperclipai/paperclip/actions/runs/45668834558"
},
{
"pull": 22956,
"run": 45667106472,
"attempt": 1,
"sha": "44406454daaad1dcfb3d70e859d01fcab7059377",
"url": "https://github.com/paperclipai/paperclip/actions/runs/45667106472"
}
],
"coverage": {
"measured": 58,
"withSetup": 58,
"inventory": 58
},
"durations": {
"tests/e2e/acp-stop-continuation.spec.ts": 94900,
"tests/e2e/action-test-agent-picker.spec.ts": 10100,
"tests/e2e/agent-chat-messages.spec.ts": 65450,
"tests/e2e/agent-chat-projects-handoff.spec.ts": 59700,
"tests/e2e/agent-chat-projects.spec.ts": 61808,
"tests/e2e/agent-chat-sessions-navigation.spec.ts": 41400,
"tests/e2e/agent-chat-sessions.spec.ts": 38500,
"tests/e2e/agent-configuration-revisions.spec.ts": 46100,
"tests/e2e/agent-configuration.spec.ts": 45300,
"tests/e2e/agentmail.spec.ts": 24250,
"tests/e2e/ai-personal-connection-recovery.spec.ts": 11450,
"tests/e2e/announcement-first-session.spec.ts": 24150,
"tests/e2e/announcement-placement.spec.ts": 24050,
"tests/e2e/app-not-connected.spec.ts": 19150,
"tests/e2e/applications-crud.spec.ts": 12050,
"tests/e2e/apps-prosumer-mcp-flow.spec.ts": 34650,
"tests/e2e/archived-company-url.spec.ts": 21300,
"tests/e2e/artifact-tab-arrival.spec.ts": 15400,
"tests/e2e/artifact-uploads.spec.ts": 56150,
"tests/e2e/board-attachment-receipts.spec.ts": 120395,
"tests/e2e/cases-read-only.spec.ts": 11100,
"tests/e2e/chat-adapters-ui-messaging-batches.spec.ts": 101700,
"tests/e2e/chat-adapters-ui-messaging.spec.ts": 107700,
"tests/e2e/chat-adapters-ui-providers-catalog.spec.ts": 135650,
"tests/e2e/chat-adapters-ui-providers.spec.ts": 141232,
"tests/e2e/chunk-load-recovery.spec.ts": 25150,
"tests/e2e/classic-workspace.spec.ts": 6850,
"tests/e2e/cloud-auth.spec.ts": 55000,
"tests/e2e/company-context-refresh.spec.ts": 3650,
"tests/e2e/completed-task-paused-assignee.spec.ts": 38400,
"tests/e2e/composer-stop.spec.ts": 34700,
"tests/e2e/conference-room-typing-intro.spec.ts": 65500,
"tests/e2e/connection-intents.spec.ts": 19550,
"tests/e2e/connection-reviews.spec.ts": 114950,
"tests/e2e/coordinator-inbox-views.spec.ts": 18900,
"tests/e2e/daytona-connector.spec.ts": 5500,
"tests/e2e/disconnect-resilience.spec.ts": 112800,
"tests/e2e/disconnect-write-recovery.spec.ts": 65350,
"tests/e2e/document-image-gallery.spec.ts": 44050,
"tests/e2e/mcp-user-stories.spec.ts": 33500,
"tests/e2e/new-task-picker-touch.spec.ts": 25400,
"tests/e2e/onboarding-resume.spec.ts": 35200,
"tests/e2e/onboarding.spec.ts": 40100,
"tests/e2e/paused-composer.spec.ts": 55850,
"tests/e2e/plan-task-fixture.spec.ts": 11100,
"tests/e2e/project-pinning.spec.ts": 7000,
"tests/e2e/project-repositories.spec.ts": 20950,
"tests/e2e/railway-catalog.spec.ts": 7400,
"tests/e2e/runner-e2e-dashboard.spec.ts": 3492,
"tests/e2e/runner-task-creation.spec.ts": 46950,
"tests/e2e/sidebar-takeover.spec.ts": 18450,
"tests/e2e/signoff-policy.spec.ts": 73155,
"tests/e2e/smoke-lab-p1-p4.spec.ts": 19650,
"tests/e2e/smoke-lab-p5-p7.spec.ts": 13450,
"tests/e2e/task-loading-frame.spec.ts": 50100,
"tests/e2e/task-reload.spec.ts": 40550,
"tests/e2e/text-attachment-tabs.spec.ts": 26950,
"tests/e2e/unikraft-connector.spec.ts": 6750
}
}