Skip to content

CI: stop duplicate runs and tolerate macOS runner shortages - #972

Merged
lieryan merged 3 commits into
masterfrom
ci-macos-runners
Nov 28, 2026
Merged

lieryan merged 3 commits into
masterfrom
ci-macos-runners

Conversation

@mcepl

@mcepl mcepl commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Description

Hosted macOS arm64 runners keep running out of capacity. Jobs then get cancelled with "The job was not acquired by Runner of type hosted even after multiple attempts" and the PR goes red even though no test failed. This happened several times on #971.

Changes:

  • Run tests / Run Black: push only for master. Before this, a PR from a branch in this repository ran every job twice for the same commit (once for push, once for pull_request), which doubled the demand for macOS runners. PRs are still tested via pull_request, and master is still tested after merges.
  • continue-on-error for macOS matrix jobs. A failing or never-started macOS job no longer fails the whole workflow.
  • timeout-minutes: 20 per test job. A job normally takes about two minutes, so a stuck job can no longer run for the default six hours.

Note: if branch protection on master lists Test - 3.12/3.13/3.14 - macos-latest as required checks, a cancelled required macOS job still blocks merging until it is re-run, because continue-on-error doesn't change the conclusion of an individual check. To remove that problem completely, make those checks non-required. After that, the macOS matrix could also be reduced, e.g. to the oldest and newest Python.

The "Run tests" and "Run Black" workflows were triggered on both
push and pull_request. For PRs from branches in the upstream
repository this ran every job twice for the same commit, doubling
the load on the scarce macOS runners. On PR #971 the push run
failed only because three macOS jobs were never picked up by a
hosted runner, while the pull_request run of the same commit
passed.

Restrict the push trigger to master, so that PR branches are
tested once through the pull_request event and master is still
tested after merges.
Hosted macOS arm64 runners on GitHub Actions are often short of
capacity, and test jobs targeting them get cancelled with "The
job was not acquired by Runner of type hosted even after
multiple attempts". This happened repeatedly on PR #971, turning
the whole "Run tests" workflow red although no test failed.

Mark the macOS matrix jobs with continue-on-error, so a failing
or never-started macOS job no longer fails the workflow, and add
a 20-minute timeout per job (a test job normally takes about two
minutes), so a hung job cannot run for the default six hours.

Note that the macOS jobs for 3.12, 3.13 and 3.14 are required
status checks in the master branch protection, so a cancelled
required job still blocks merging until it is re-run or the
checks are made non-required.
@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.45%. Comparing base (20c118a) to head (9bd842d).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #972   +/-   ##
=======================================
  Coverage   95.45%   95.45%           
=======================================
  Files         134      134           
  Lines       26926    26926           
=======================================
  Hits        25702    25702           
  Misses       1224     1224           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lieryan

lieryan commented Nov 28, 2026

Copy link
Copy Markdown
Member

I've updated the required checks so that for macos only the oldest and newest python versions are required checks. They're still required for linux and windows tests as they don't seem to be a cause for problems.

@lieryan lieryan left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks reasonable to me, approved.

@lieryan
lieryan enabled auto-merge November 28, 2026 15:06
@lieryan
lieryan merged commit 7dfc36a into master Nov 28, 2026
24 checks passed
@lieryan
lieryan deleted the ci-macos-runners branch November 28, 2026 15:09
@lieryan lieryan added this to the 1.16.0 milestone Nov 28, 2026
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.

2 participants