Skip to content

ci: record the Chromium interaction times from a full run, so no leg plans past ten minutes on a stale time - #12703

Merged
cixzhang merged 1 commit into
mainfrom
ci/interaction-chromium-times
Nov 19, 2026
Merged

cixzhang merged 1 commit into
mainfrom
ci/interaction-chromium-times

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

Who this helps

Authors whose pull request runs the full Chromium interaction suite. Leg 5 of 6 in run 44389311720 (#12644) passed all of its tests in 13.6 minutes and was then cancelled at the 15-minute job limit. The planner had costed that leg at about 461 s plus 90 s of setup, but the times it planned from were recorded on 11/08 and no longer match the suite:

  • LightboxPaging.interaction.browser.spec.ts was recorded at 100.9 s and ran 403 s.
  • LightboxZoom was recorded at 95.1 s and ran 140 s.
  • 27 of the suite's 127 spec files had no recorded time and were costed at the mean time a test.

What changes

  • .github/playwright-leg-durations.json: the interaction-chromium times are re-recorded with node .github/scripts/playwright-legs.mjs record --key interaction-chromium --project chromium from all six Chromium legs of that full run (all 127 spec files, about 3,190 s of proofs; the cancelled leg had already finished its tests). The planner and its limits are unchanged: at 600 s a leg and 90 s of setup, the suite now plans 7 legs of about 456 s each (about 9 minutes with setup) instead of 6 legs it could not keep.
  • playwright-legs.test.mjs: the record must time at least nine in ten of the spec files the suite runs (an untimed spec is costed at the mean time a test, which undercounts a slow one), and the whole suite planned from the record with the leg count job's limits must leave every leg within 12 minutes.

No timeout changes.

Tests

  • Red-first: on main's record the coverage check fails (100 of 127 files timed); with this record both new checks pass. The rest of playwright-legs.test.mjs passes, except one case that fails the same way on main on this machine (it lists specs through Playwright from a copy outside the checkout).
  • Prettier clean.

CI impact

CI impact: a full Chromium interaction run takes 7 legs instead of 6, about 9 minutes each instead of up to 13.6 (and a cancelled leg). The same job-minutes in total, on the same runner class.

Overlap checked: none

Owning session: noopbot (a61f66c2), under CI & Release (ca77f950). Land path: the shipper, through merge-guard, on green, CodeBunny approval and Specs' exact-head /approve-spec.

@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 18, 2026 10:14pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 18, 2026
@astracat-bot

astracat-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 18, 2026, 10:36 PM UTC

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 750ef10

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 750ef10

Storybook · Sandbox · built from this PR's head

Package size: no published package changed; no new dependencies.

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.

CI impact: 0 job-min per update · pool 0% · time to green +37.1 min · standard runners · 1 CI action or script file changed (not measured) ⚠️
Before After Change
Job-minutes per PR update 173.5 173.5 0
Runner pool, runner-minutes a day 51,781 51,781 0 (0%)
Average concurrent jobs 36 36 0
Time to green (median → this run) 27.8 min 65 min +37.1 min
Runs a day 298 298 0

Not measured (the jobs that use these keep their recent minutes above): .github/scripts/playwright-legs.test.mjs.

Flags: time to green +37.1 min.

Assumptions: before is each job's average over the last 20 pull-request runs; after keeps that for unchanged jobs and uses this run's minutes for added or changed ones, weighted by how often each changed job ran in those runs; runs a day averages the seven whole days before today; time to green compares this run with the median of those runs that ran the same jobs.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI. The re-record is faithful: re-running playwright-legs.mjs record --key interaction-chromium --project chromium on that run's six Chromium leg logs reproduces .github/playwright-leg-durations.json byte for byte, and the 129 listed specs now plan into 7 legs of 456-459 s (9.1 minutes with the 90 s of setup) instead of the 6 legs whose fifth was cancelled at the job limit. The heavy suites have not run on this head, so this is not "ready to merge": the merge guard still needs them green once the pull request leaves draft.

No blocking findings. Three things worth your eye:

  • The coverage case turns test-node red on every open pull request once 13 more interaction specs exist (127 timed of the tree's 129 today; red at 142 files), and the failure reads only expected 0.894 to be greater than or equal to 0.9 — it names neither the record command nor who re-records. The Node record solves the same drift with an automatic refresh and never fails a pull-request check on coverage; worth either matching that shape or at least naming the remedy in the assertion.
  • The new leg case prices an untimed spec at seconds-per-test for the leg count but at the median recorded time inside planLegs, and the lane itself prices it at the WebKit time, then its test count × the mean. Building the costs with costsFor/estimateSeconds and fallback: durations['interaction-webkit'], as the case at line 1411 does, keeps the test honest to the planner.
  • The 12-minute case largely repeats "fits every leg in ten minutes at today's recorded times, within the matrix", which is stricter and covers both lanes — and which passes on main's record, so it is the coverage case that does the work here.

One correction for the description: on main the coverage check counts 129 interaction spec files, not 127 (100 timed, 0.775); 127 was the count at the measured run's head.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Leg 5 of 6 passed every test in 13.6 minutes and was then cancelled at the 15-minute job limit — verified in that job's log.
  • The planner had costed that leg at about 461 s plus 90 s of setup — verified in the leg count and plan lines of the same run.
  • The times it planned from were recorded on 11/08 — verified from the record's own history.
  • LightboxPaging was recorded at 100.9 s and ran 403 s; LightboxZoom at 95.1 s and ran 140 s — verified against the re-recorded values (403.5 s, 140.2 s).
  • 27 of that run's 127 spec files had no recorded time and were costed at the mean time a test — verified: 27 untimed, none with a WebKit time, so each fell through to its test count times the mean.
  • The record is re-recorded with the named command from all six Chromium legs, all 127 spec files, about 3,190 s — verified: the command reproduces the file byte for byte, 127 entries, 3,191.9 s.
  • The planner and its limits are unchanged — verified: neither the planner nor the workflow is in the diff.
  • The suite now plans 7 legs of about 456 s each, about 9 minutes with setup, instead of 6 — verified: 7 legs of 456.5-458.9 s, 546.5-548.9 s with setup.
  • The two new checks do what the description says — verified by reading and running them.
  • No timeout changes — verified.
  • Red-first: the coverage check fails on main's record and both new checks pass here — verified, with the count correction above.
  • The rest of the file passes except one case that fails the same way on main — not reproduced: in this review's sandbox seven cases fail identically on both trees because it refuses to create a scratch git repository; no case fails on this head that passes on the base.
  • Prettier clean — verified.
  • CI impact: 7 legs instead of 6, about 9 minutes each instead of up to 13.6, the same job-minutes on the same runner class — verified; the total also carries one extra leg's 90 s of setup.
  • .github/playwright-leg-durations.json — clear: every one of its 127 entries names a file that exists at this head, the entries are sorted, and no value departs from the generated record.
  • .github/scripts/playwright-legs.test.mjs — the four non-blocking findings above; the rest of the block reads correctly, and its git ls-files call takes a fixed argument list with no shell and no untrusted input.

Automated review (maintainer link)

// undercounts a slow spec; the legs then run past the time they planned.
expect(specs.length).toBeGreaterThan(100);
const timed = specs.filter(file => recorded[file] != null);
expect(timed.length / specs.length).toBeGreaterThanOrEqual(0.9);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nothing re-records this file, so coverage only falls: with 127 timed of the tree's 129 interaction specs, the 13th spec added before the next re-record (127/142 = 0.894) turns test-node red for every open pull request, and the author sees only expected 0.894 to be greater than or equal to 0.9.

The Node record meets the same drift with a refresh job that opens a durations pull request, and AST-030 FR22 adds "No pull-request check fails on the record's coverage". At a minimum, let the failure name its remedy:

expect(
  timed.length / specs.length,
  'Re-record with: node .github/scripts/playwright-legs.mjs record --key interaction-chromium --project chromium <job logs>',
).toBeGreaterThanOrEqual(0.9);

const seconds = specs.reduce(
(sum, file) =>
sum +
(recorded[file] ??

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This prices a spec with no recorded time at seconds-per-test (1.72 s), while planLegs below prices the same spec at the median recorded time (about 9 s), and the lane itself prices it at the WebKit time, then its test count times the mean, then the median (estimateSeconds, costsFor). With two untimed specs the gap is under 20 s; at the 90% floor this case allows it is about 110 s the leg count never sees.

costsFor(specs, recorded, {fallback: durations['interaction-webkit'], testsOf, perTest}), as the case at line 1411 builds it, keeps the check honest to the planner it models.

@cixzhang
cixzhang marked this pull request as ready for review November 18, 2026 22:36
@cixzhang
cixzhang marked this pull request as draft November 18, 2026 23:24
@cixzhang
cixzhang marked this pull request as ready for review November 18, 2026 23:24
@cixzhang
cixzhang merged commit ad320a1 into main Nov 19, 2026
201 of 208 checks passed
@github-actions
github-actions Bot deleted the ci/interaction-chromium-times branch November 19, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — 750ef10f Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant