-
-
Notifications
You must be signed in to change notification settings - Fork 797
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
Speed up tests ~2x #1352
Speed up tests ~2x #1352
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1352 +/- ##
=======================================
Coverage 97.54% 97.54%
=======================================
Files 32 32
Lines 2120 2120
=======================================
Hits 2068 2068
Misses 52 52 📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
|
b0879c7
to
8af7670
Compare
8af7670
to
8227484
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adamchainz As a maintainer who updates a lot of branches and spends a lot of time waiting on CI spinners, I can't tell you how much I appreciate this!
@adamchainz @dopry not sure why but I've noticed that all the tests run and then the last two |
@n2ygk, Success needs to wait on the matrix build to complete. It can't be bundled into the same. can you open a new issue linking to an example? |
@dopry not point opening a new issue if we are stuck with the current situation. Still better than the old way. |
If you can't point to an example of the issue I can't troubleshoot it further and I suspect it is not directly related to reducing the overheat to setup test data, but is more likely related to capacity or organizational throttling by GH. Correlation is not causation. |
But I think I should have been commenting on #1219 |
Description of the Change
Speed up the test suite to be about twice as fast, using these techniques:
setUpTestData()
, so it runs only once per test case. See my post.tearDown()
methods that removed model instances. These were always unnecessary as Django resets the database for you.RequestFactory
s to class-level variables.Measuring on the Python 3.12 and Django 5.0 environment (added in #1350), I got 207s before these changes and 105s afterwards, approximately twice as fast.
Checklist
CHANGELOG.md
updated (only for user relevant changes)AUTHORS