Repository navigation
ci(studio): re-run an edit accuracy shard on a fresh runner when its runner is too slow - #5659
Merged
Merged
Conversation
…runner is too slow
Contributor
Edit accuracy: accurate 271 (base branch 271), smooth 129 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (1)
|
jrusso1020
approved these changes
Oct 15, 2026
jrusso1020
left a comment
Collaborator
There was a problem hiding this comment.
Approved at 6b4a3e846c72e7af9796274990d21165196bec46. I read the workflow jobs in full, ratchet.mjs gate, run.mjs, report.mjs and the new tests. I checked whether the retry can hide a real failure, and I found no way for it to.
- Only slow or cancelled shards are retried. The mark step writes
retryonly whenjob.statusiscancelledor aslow-runner.jsonexists. A bench that finishes with failing cases exits normally, so it is never marked. The plan job then lists no shards, the retry job is skipped, and the gate judges the original evidence.run.mjswritesslow-runner.jsononly onceslowRunnertrips on the first four cases' median (> 60 s). - One retry at most. The retry job runs
edit-accuracy-shard.shbut has no mark step, and the plan job depends only on the original matrix. Nothing can queue a second retry. - It fails closed. A stopped bench exits 75 before
writeReport, so neither the slow first run nor a slow retry leaves aresults.json. If the retry is slow again, hangs again, or never uploads (withif-no-files-found: error, the original marker-only artifact stays), the gate counts19 of 20 shards reported resultsand fails. If a retry runner stops during the--rerunpasses, the cases keep only their first run. Underpasses(), a single failing run still fails (1×2 < 1 is false), so losing the confirmations can't turn a failure into a pass. - Evidence is replaced, not merged. The artifact keeps the same
edit-accuracy-shard-Nname withoverwrite: true, so the gate never mixes the slow runner's partial evidence with the fresh run's. - Steps really run after a timeout. In run 38754829357, shard 7/20 ended
cancelled, and itsif: always()"Upload shard evidence" step still succeeded. So the mark step, which runs between the bench and the upload, will seecancelledin the case this PR targets. - Merge queue. Only
Studio: edit accuracy gateis required, and it now waits for the retry with!cancelled(). A skipped retry (no marked shards) doesn't block it. The retry job takesSHARDSandEDIT_ACCURACY_GRIDfrom the samemerge_groupvspull_requestswitch as the matrix (20/full or 5/pr), so a retried shard runs the same slice. Timeouts: 25 + 5 + 25 + 5 = 60. That leaves out Build (3.3 min in run 38754829357) and runner pickup, so a worst case of shard timeout plus retry timeout could run past the 60 min check wait. The case this fixes stops after four cases, though, so it finishes well inside. - Path filter.
scripts/ci/edit-accuracy-shard.shis in theedit_accuracyfilter.check-edit-accuracy-filter.test.mjsnow follows.shfiles that a step runs, and it includes the retry job, so the moved bench command stays covered.
Nits, not blocking:
- When a real perf regression makes every case slow, the gate reports a missing shard rather than naming the slow cases. It still fails, and
slow-runner.jsonin the retry artifact explains why, but the PR comment won't say so. - A skipped retry job shows up as
Studio: edit accuracy retry (${{ matrix.shard }}). That's cosmetic.
All required CI is green at this head; the retry path was skipped on this PR since no shard was slow. I didn't trigger a retry myself.
— Rames
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A merge queue edit accuracy shard that lands on a slow runner now stops after its first four cases and runs once more on a fresh runner, instead of running into its timeout and dropping the PR from the queue.
Why
In merge queue run 38754829357,
Studio: edit accuracy (7/20)was cancelled at its 45 minute timeout and the PR left the queue. No test hung. The runner was about 5x slow before any test ran:bun run --cwd packages/core buildThe slow cases failed their time-based checks (15 previews never held still within 15 s), so 18 of 38 cases differed from the base branch, and their two confirmation re-runs started on the same slow machine. The other 19 shards took 6-9 min; shard 7 took 5-8 min in the 14 queue runs before it.
The blank-page control does not show this: its rAF p95 median was 17.1 ms on the slow runner and 16.9 / 17.0 ms on shards 6 and 8. Case wall time does.
Related work
Refs #5646 (dropped from the queue by this run).
How
slowRunner(report.mjs): the first 4 cases' median wall time over 60 s marks a slow runner. Across all 20 shards of a healthy queue run (38730689165) the slowest first-four median was 22 s; shard 7's was 95.5 s.run.mjs: once marked, no new case starts; the browsers close as usual,slow-runner.jsonis written and the bench exits 75.scripts/ci/edit-accuracy-shard.sh: the shard step's script, unchanged, moved out of the workflow so the re-run job runs the same thing.ci.yml:retry) in its evidence;studio-edit-accuracy-retry-planlists the marked shards;studio-edit-accuracy-retryruns each of them once on a fresh runner and replaces that shard's evidence artifact (overwrite: true);Test plan
report.test.mjs: shard 7's first cases (95.5, 133.7, 57.9, 107.5 s) stop the shard; a healthy first four (22 s median) and one with a single 92.7 s case pass; fewer than 4 cases never judge.scripts/edit-accuracy-retry.test.mjsruns the mark and plan steps' own shell. It checks that a cancelled or slow shard is marked and a successful one is not, and that the plan lists exactly the marked shards ([7,12],[]). It also checks that the re-run replaces the evidence, that the gate waits for it, and that the timeouts fit in 60 min.check-edit-accuracy-filter.test.mjsnow follows shell scripts a step runs, so the moved bench command stays covered by the path filter.ci.yml;report.mjs.overwrite, a gate that does not wait for the re-run, and a limit of 200 s or 20 s.prgrid shard with the limit lowered to 1 s stopped after 4 cases with exit 75 andslow-runner.json, closed its browsers and left no orphan process. oxfmt, oxlint and actionlint are clean.