Skip to content

feat: run unit tests in parallel - #1566

Merged
ZohebShaikh merged 3 commits into
mainfrom
test-pytest-xdist
Jun 25, 2026
Merged

ZohebShaikh merged 3 commits into
mainfrom
test-pytest-xdist

Conversation

@ZohebShaikh

@ZohebShaikh ZohebShaikh commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

As we have a 4 core GitHub action run we can utilise it more efficiently by running all our unit test in parallel.

Currently it take the following amount of time to run unit test

  • python3.11: 2m vs now 59s
  • python3.12: 2m 1s vs now 1m 28s
  • python3.13: 1m 44s vs now 1m 12s

It is consistently less in the future it will be a nice addition to run system test in parallel as well. It will require some more work so will do it in another PR.

@codecov

codecov Bot commented Jun 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.91%. Comparing base (50fd3dd) to head (0600ca3).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1566   +/-   ##
=======================================
  Coverage   95.90%   95.91%           
=======================================
  Files          44       44           
  Lines        3250     3255    +5     
=======================================
+ Hits         3117     3122    +5     
  Misses        133      133           

☔ 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.

@ZohebShaikh
ZohebShaikh marked this pull request as ready for review June 25, 2026 11:09
@ZohebShaikh
ZohebShaikh requested a review from a team as a code owner June 25, 2026 11:09
Comment thread pyproject.toml
testpaths = "docs src tests"
asyncio_mode = "auto"
timeout = 3
timeout = 10

@ZohebShaikh ZohebShaikh Jun 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think when tests are running in a different core sometimes it takes longer for the same test to complete which needs this extra timeout.
Might need to look if this can be optimized any further

@tpoliaw tpoliaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tests now take <10s on my machine 🤯. It is slightly quicker to use -n 8 instead of logical as the time to set up the workers starts taking longer than the tests but as a default it makes sense (and is still faster than running single threaded).

in the future it will be a nice addition to run system test in parallel as well

I think that will be difficult as many of the calls to the server can't be run if another task is running or if the state is not known.

@ZohebShaikh
ZohebShaikh added this pull request to the merge queue Jun 25, 2026
Merged via the queue into main with commit a7c7d93 Jun 25, 2026
19 checks passed
@ZohebShaikh
ZohebShaikh deleted the test-pytest-xdist branch June 25, 2026 11:48
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