Skip to content

👷 Speed up the CI by shuffling the test matrix - #1815

Merged
tiangolo merged 5 commits into
fastapi:masterfrom
svlandeg:fix/ci
Jun 2, 2026
Merged

tiangolo merged 5 commits into
fastapi:masterfrom
svlandeg:fix/ci

Conversation

@svlandeg

@svlandeg svlandeg commented Jun 1, 2026 •

Copy link
Copy Markdown
Member

Description

This PR changes the test matrix. Before, it was taking almost 5 minutes for the tests to run with the "lowest-direct" setting on a Windows runner. Increasing the lower bounds helped somewhat, but not enough. That's why this PR moves this particular setting to Mac OS, succesfully getting all tests below 2 minutes.

"Test" timing on "lowest-direct", ✅ indicates the settings used in this PR, ❌ indicates master

3.10 3.10 + lower bumps 3.12 3.12 + lower bumps
Windows 4 min 40 ❌ 3 min 50
MacOS 2 min 45 1 min 54 ✅
Ubuntu 1 min 28 ❌ 1 min 10 ✅

(times vary between runs, but this gives a ballpark idea)

  • It's likely that Windows is particularly slow because new processes use spawn instead of fork, and our test suite has many coverage run / subprocess launches.

  • Bumping pytest-cov / pytest-sugar / pytest-xdist lower bounds keeps "lowest-direct" viable on pytest 9. The bump uncovered an issue with the get_binary_stderr test which wasn't calling coverage correctly.

AI Disclaimer

No AI used for the edits, only for generating hypotheses / explanations. All experiments & analyses by yours truly.

Checklist

  • Coverage stays at 100%.

@svlandeg svlandeg added the internal Internal changes label Jun 1, 2026
@svlandeg svlandeg changed the title 👷 Adjust CI test matrix to avoid running lower bounds on a Windows runner 👷 Adjust CI test matrix to avoid running older dependencies on the Windows runner Jun 1, 2026
@github-actions

github-actions Bot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

@svlandeg
svlandeg marked this pull request as ready for review June 1, 2026 21:01
@svlandeg svlandeg changed the title 👷 Adjust CI test matrix to avoid running older dependencies on the Windows runner 👷 Speed up the CI by shuffling the test matrix Jun 1, 2026

@tiangolo tiangolo 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.

Niceee! Yesss, thank you! 🚤

@tiangolo
tiangolo merged commit 2e9bf9e into fastapi:master Jun 2, 2026
21 checks passed
@svlandeg
svlandeg deleted the fix/ci branch June 2, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Internal changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants