Skip to content

ci: cancel in-progress E2E matrix runs on the same PR branch - #1091

Merged
travagliad merged 1 commit into
mainfrom
cursor/workflow-concurrency
Jul 21, 2026
Merged

ci: cancel in-progress E2E matrix runs on the same PR branch#1091
travagliad merged 1 commit into
mainfrom
cursor/workflow-concurrency

Conversation

@travagliad

Copy link
Copy Markdown
Contributor

Why

Every push to a PR branch triggers the full 30-job E2E tests matrix (~30 min). Rapid iteration (e.g. dependency fix attempts) spawns parallel matrix runs with no cancellation, wasting CI minutes.

How

Add a concurrency group to e2e-tests-matrix.yml keyed by the target branch name. cancel-in-progress is enabled only for pull_request events, so:

  • PR branches: new push cancels the in-progress matrix run
  • main (schedule / manual dispatch): runs are not cancelled — RC testing and nightly jobs can overlap as before
  • Different branches: run in parallel (separate concurrency groups)

Add a concurrency group keyed by the target branch so rapid pushes
to a pull request cancel the previous matrix run instead of spawning
parallel 30-job suites. Scheduled and manual runs on main are
unaffected (cancel-in-progress is PR-only).
@travagliad

Copy link
Copy Markdown
Contributor Author

Test Healer — PR #1091 validation results

Run: E2E tests Matrix #29782815602
Branch: cursor/workflow-concurrency
Event: pull_request

CI summary (30 matrix jobs)

Result Count
✅ Pass 30
❌ Fail 0
⏳ Pending 0

All green. The concurrency change does not break the E2E matrix workflow.


Change under test

concurrency:
  group: e2e-tests-${{ github.event_name == 'pull_request' && github.head_ref || (github.event.inputs.pmm_qa_branch || github.ref_name) }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}
Scenario Behaviour
PR push to same branch Cancels in-progress matrix run (new group key = head_ref)
workflow_dispatch on main No auto-cancel (cancel-in-progress: false)
Nightly schedule on main No auto-cancel
Different PR branches Run in parallel (separate group keys)

Cross-check vs #1092 (same CI run window)

Jobs that failed on #1092 passed here on unmodified main deps:

Job #1092 #1091
@pgsm-pmm-integration ❌ Docker network flake ✅ pass (28m55s)
@mongodb-exporter ❌ PMM-T1333 dashboard timing ✅ pass (41m59s)

Confirms those #1092 failures were flakes, not caused by dependency changes.


Recommendation

Ready to merge. Low-risk CI-only change; full matrix validated green.

@cursor
cursor Bot force-pushed the cursor/workflow-concurrency branch from e4b16b1 to cdb4ab9 Compare July 20, 2026 23:48
@travagliad

Copy link
Copy Markdown
Contributor Author

Concurrency test results

Tested by pushing two commits in quick succession to cursor/workflow-concurrency while the matrix was already running.

Test procedure

  1. Push 1 (d34734a) — empty commit at 23:47:47 UTC → run #29788349174 started (in_progress)
  2. Push 2 (e4b16b1) — empty commit at 23:48:10 UTC (23s later) → run #29788368254 started
  3. Cleanup — force-pushed back to cdb4ab94run #29788409249 started, cancelling run 2 as well

Results

Run Commit Trigger Outcome
#29788349174 d34734a push 1 cancelled after 42s (all started jobs cancelled)
#29788368254 e4b16b1 push 2 cancelled when force-push arrived
#29788409249 cdb4ab94 cleanup in progress (sole active run)

At no point were two matrix runs active on the same branch — each new push cancelled the previous one within ~20s.

Verified behaviour

  • cancel-in-progress: true on pull_request events works as intended
  • Concurrency group e2e-tests-cursor/workflow-concurrency correctly deduplicates runs on the same branch
  • Probe commits were removed (branch reset to cdb4ab94); only the concurrency YAML change remains

Concurrency feature confirmed working.

@travagliad
travagliad merged commit d70fd36 into main Jul 21, 2026
62 checks passed
@travagliad
travagliad deleted the cursor/workflow-concurrency branch July 21, 2026 10:00
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