Skip to content

Cancel superseded Test runs per branch - #460

Merged
Sayan- merged 1 commit into
mainfrom
hypeship/test-concurrency-cancel
Aug 27, 2026
Merged

Cancel superseded Test runs per branch#460
Sayan- merged 1 commit into
mainfrom
hypeship/test-concurrency-cancel

Conversation

@Sayan-

@Sayan- Sayan- commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Test runs on every push to every branch, and superseded runs kept running: pushing a stack of branches repeatedly can put dozens of full runs in flight at once, with only the newest per branch mattering. Since the linux test job runs on the shared self-hosted pool, the stale runs starve every other repo's CI (kernel/kernel jobs were queuing 30+ minutes behind one such burst).

This adds workflow-level concurrency grouped by ref with cancel-in-progress, so a newer push cancels the older run for that branch. Two deliberate exclusions:

  • main pushes and workflow_dispatch (slash-command) runs get run_id as their group, one group per run. They are never cancelled, and never coalesced either: sharing a group is unsafe even with cancellation off, because GitHub cancels an existing pending run when a newer one enters the group, which would drop a commit's only test signal.
  • The existing job-level concurrency on the macOS jobs is untouched; it still serializes access to the small mac runner pool across runs.

Note on rollout: push-event runs read the workflow file from the pushed commit, so this takes effect for a branch once it contains this change (i.e. after rebasing onto main). Runs already queued are unaffected.

🤖 Generated with Claude Code


Note

Low Risk
CI-only workflow change; no application code or runtime behavior is affected.

Overview
Adds workflow-level concurrency to the Test workflow so rapid pushes on feature branches do not pile up full Linux self-hosted runs that block the shared runner pool.

For push events on non-main refs, runs share a concurrency group keyed by github.ref, with cancel-in-progress: true, so only the latest push per branch keeps testing. main pushes and workflow_dispatch (slash-command) runs use github.run_id as the group and are not cancelled—avoiding GitHub’s behavior where a new run in the same group can drop a pending run even when cancellation is disabled.

Existing job-level concurrency on the macOS jobs is unchanged.

Reviewed by Cursor Bugbot for commit 897e7b7. Bugbot is set up for automated code reviews on this repo. Configure here.

@Sayan-
Sayan- marked this pull request as ready for review August 26, 2026 20:54
Test triggers on every push to every branch with nothing cancelling the
runs a newer push obsoletes, so rapid iteration on a branch stack piles
up full runs that hold self-hosted slots every repo on the shared pool
queues behind. Group runs by ref with cancel-in-progress so only the
newest run per branch survives; main and workflow_dispatch runs get a
unique group per run and are never cancelled or coalesced.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Sayan-
Sayan- force-pushed the hypeship/test-concurrency-cancel branch from ac89cd6 to 897e7b7 Compare August 26, 2026 20:57

@sjmiller609 sjmiller609 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

good call

@Sayan-
Sayan- merged commit b2363e5 into main Aug 27, 2026
13 of 15 checks passed
@Sayan-
Sayan- deleted the hypeship/test-concurrency-cancel branch August 27, 2026 15:38
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.

3 participants