Cancel superseded PR runs in the test workflows - #7170
Merged
Merged
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
albertvillanova
force-pushed
the
cancel-superseded-test-runs
branch
from
September 10, 2026 14:06
b6f8c0a to
5dd210e
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5dd210e. Configure here.
albertvillanova
added this pull request to stack #7173
September 10, 2026 14:13
This was referenced Sep 14, 2026
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 does this PR do?
build_pr_documentation.ymlcancels a PR's in-flight run when a new commit is pushed to the same branch.tests.ymlandtests-experimental.ymldo not, so every push to an open PR leaves the previous run occupying runners until it finishes on its own, testing a commit nobody will merge.Over 2026-08-26 to 2026-09-10, 341 PR runs of
tests.ymlwere superseded by a newer commit on the same branch and kept running anyway. 64 GPU-hours of that was spent after the superseding run had already been created. That capacity is shared, so those runs also sit ahead of other PRs in the queue.tests.ymlbooks five GPU jobs per run (four onaws-g6e-4xlarge, one onaws-g5-12xlarge-cache), around 77 runner-minutes per full matrix.This adds the same
concurrencyblock the doc workflow already uses, keyed on the pull request number.github.event.pull_request.numberis empty forpushevents, so the group falls back to the uniquegithub.run_idand pushes tomainand toci-*branches are never cancelled. Only PR runs superseded by a newer commit on the same PR are.The doc workflow keys on
github.head_ref, which is only the branch name and is shared across forks, so two PRs that both use a branch calledpatch-1would cancel each other. Bugbot caught that on the first version of this PR. No two open PRs share a head branch name today, but 130 of the 182 open ones come from forks, so the collision is reachable and the PR number costs nothing.build_pr_documentation.ymlstill carries thehead_refform and could be aligned separately.The 64 hours is the reclaimable part, not the full 352 hours those runs consumed, and it counts
tests.ymlonly, so the estimate is conservative.Part of #7169.
Note
Low Risk
CI-only workflow configuration; no application or test logic changes, only earlier termination of obsolete PR runs.
Overview
Adds GitHub Actions concurrency to
tests.ymlandtests-experimental.ymlso an older workflow run is cancelled when a newer commit triggers another run for the same PR.Each workflow uses
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}withcancel-in-progress: true, matching the pattern already used for PR doc builds. PRs share one group per workflow via the PR number; non–pull-request triggers fall back torun_id, so pushes tomainandci-*are not cancelled by each other.Reviewed by Cursor Bugbot for commit 4dca50d. Bugbot is set up for automated code reviews on this repo. Configure here.