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

Tests: Speed up test_rm_with_1k_objects_or_more #294

Merged
merged 1 commit into from
Oct 9, 2024
Merged

Conversation

AdrianoKF
Copy link
Contributor

By employing simple asyncio thread parallelism, the execution of the test_rm_with_1k_objects_or_more test is sped up from ~60s to around ~5s.

Unfortunately, this requires the pytest-asyncio plugin, but IMO the overall speedup is worth the extra dev dependency.

@AdrianoKF AdrianoKF self-assigned this Oct 9, 2024
@AdrianoKF AdrianoKF added the enhancement New feature or request label Oct 9, 2024
Copy link

codecov bot commented Oct 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.26%. Comparing base (b80507c) to head (ed932d1).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #294   +/-   ##
=======================================
  Coverage   94.26%   94.26%           
=======================================
  Files           5        5           
  Lines         401      401           
  Branches       90       90           
=======================================
  Hits          378      378           
  Misses         14       14           
  Partials        9        9           
Flag Coverage Δ
3.10 93.76% <ø> (ø)
3.11 93.76% <ø> (ø)
3.12 93.76% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Collaborator

@nicholasjng nicholasjng left a comment

Choose a reason for hiding this comment

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

Great stuff!

Why is pytest-asyncio required now? Is that just obligatory once you have an async test?

Copy link
Contributor Author

@AdrianoKF AdrianoKF left a comment

Choose a reason for hiding this comment

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

Why is pytest-asyncio required now? Is that just obligatory once you have an async test?

Yup, otherwise there's no asyncio event loop (I guess you could spawn your own as part of the test functions, but it might become iffy quickly).

@AdrianoKF AdrianoKF merged commit 9e47e70 into main Oct 9, 2024
12 checks passed
@AdrianoKF AdrianoKF deleted the test-speedup branch October 9, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants