Skip to content

Conversation

@souhailaS
Copy link
Contributor

Overview

Adds concurrency control to TestSuite-PR.yml workflow using ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} with cancel-in-progress: true to prevent overlapping test runs and optimize resource usage.

This workflow need an average of ~52min to complete. Analysis of 200 recent workflow runs from 692 total executions reveals significant inefficiencies: 60 overlapping run pairs were identified, with 35 same-branch overlaps being most problematic. The sqs-dt-truncate branch had 19 overlapping runs, main had 7, and spring-kafka had 5. This resulted in approximately 1,649 minutes (27.5 hours) of overlapping execution time where resources were duplicated, representing 30% of all runs experiencing overlaps. Real-world examples include main branch runs starting just 2 minutes apart but running simultaneously for 42 minutes each.

Related Github Issue

Addresses workflow resource inefficiencies identified through GitHub API analysis of recent workflow executions.

Testing

Test by pushing multiple commits rapidly to a PR and verifying new runs cancel previous ones, while different PRs can still run in parallel. Configuration-only change with no impact on existing test logic.

Checks

  • Your contributions are backwards compatible with relevant frameworks and APIs.
    • This is a workflow configuration change that doesn't affect any application code or APIs
  • Your code does not contain any breaking changes. Otherwise please describe.
    • No breaking changes - this is purely additive workflow optimization
  • Your code does not introduce any new dependencies. Otherwise please describe.
    • No new dependencies - uses existing GitHub Actions concurrency features

Additional context

We are a team of researchers from University of Zurich (https://www.ifi.uzh.ch/en/zest.html) currently working on automating energy optimizations in GitHub Actions workflows. This optimization maintains full functionality while reducing computational overhead and energy consumption.

souhaila.serbout@uzh.ch

- Add concurrency group using workflow name and git reference
- Enable cancel-in-progress to cancel older runs when new commits are pushed
- Improves resource usage and ensures only latest changes are tested
- Use PR number for pull request concurrency groups instead of ref
- Ensures each PR has its own concurrency group and doesn't block other PRs
- Falls back to ref for pushes to main and workflow_dispatch events
- Maintains cancel-in-progress behavior within the same PR
@CLAassistant
Copy link

CLAassistant commented Jul 15, 2025

CLA assistant check
All committers have signed the CLA.

@jtduffy jtduffy mentioned this pull request Jul 17, 2025
@jtduffy jtduffy merged commit db81b98 into newrelic:main Jul 24, 2025
355 of 360 checks passed
@github-project-automation github-project-automation bot moved this from Triage to Code Complete/Done in Java Engineering Board Jul 24, 2025
@kmudduluru kmudduluru moved this to Code Complete/Done in Java Engineering Board Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants