Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: Improve test performance by parallelizing pytest #662

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

AnsahMohammad
Copy link
Contributor

@AnsahMohammad AnsahMohammad commented Mar 9, 2025

While working on #67 , discovered that pytest -n X enables parallel test execution, where X is the number of cores. This can significantly reduce test execution time.

Though it didn’t resolve the issue in #67, it could substantially speed-up automated tests.

image
On my 8-core machine, runtime dropped from 43.67s to 20.07s.

@AnsahMohammad AnsahMohammad changed the title feat: Improve test performance by parallelizing pytest perf: Improve test performance by parallelizing pytest Mar 9, 2025
@ahal
Copy link
Collaborator

ahal commented Mar 10, 2025

Thanks, this seems reasonable to me!

However I'm not sure why those tests are failing.. Normally I'd dismiss the failures as not related to a change like this, but it's weird that only the py310 tests pass. So that leads me to think that it is something to do with the parallelization. Very strange.

I think we'll need to sort this before landing, this failure isn't happening on the main branch.

@ahal ahal self-requested a review March 10, 2025 14:27
Copy link
Collaborator

@ahal ahal left a comment

Choose a reason for hiding this comment

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

Requesting changes to investigate the test issue. If you get stuck, I can poke around when I have some time, though not sure when that will be

@AnsahMohammad
Copy link
Contributor Author

Thanks for reviewing! I’ll look into the test failures and see if the parallelization is causing issues.

Requesting changes to investigate the test issue. If you get stuck, I can poke around when I have some time, though not sure when that will be

Thanks, I'll reach out if i get stuck

@AnsahMohammad
Copy link
Contributor Author

Looks like the issue is definitely coming from parallelization since the failures changed when I tweaked the distribution strategy :/ . I'll try to dig deep and see if its fixable.

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