[Django] #35322: Slow feedback loop in tests using Postgres

15 views
Skip to first unread message

Django

unread,
Mar 21, 2024, 11:05:16 AM3/21/24
to django-...@googlegroups.com
#35322: Slow feedback loop in tests using Postgres
-----------------------------------------+------------------------
Reporter: Martin Lehoux | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 5.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
I have a growing codebase, and the tests are getting slower and slower. My
main concern is when iterating on a small test case, the overhead of
running tests is the largest part of the runtime (as opposed to running
all tests in continuous integration). I am running tests with pytest-
django, my database is a postgres running in a docker-compose.

My baseline was 20sec with --keedp-db. I made some improvements that were
easily accessible : --no-migration gave me a 3sec improvement.

But while digging into the code, it seems that whatever options I provide,
I cannot skip the `call_command("migrate" ...)` part. I wonder why this is
the case, because commenting this part gave me a 5.5 sec improvement.

I must say my django startup time has risen up a lot, at around 5 sec.

Is there something I'm missing about running small tests?
--
Ticket URL: <https://code.djangoproject.com/ticket/35322>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 21, 2024, 11:17:58 AM3/21/24
to django-...@googlegroups.com
#35322: Slow feedback loop in tests using Postgres
-------------------------------+--------------------------------------
Reporter: Martin Lehoux | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 5.0
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by David Sanders):

* resolution: => invalid
* status: new => closed

Comment:

Hi there 👋

Please don't raise tickets for asking questions or support requests about
using Django. Head over to the forum or Discord where a friendly member
of the community will help you: https://www.djangoproject.com/community/
--
Ticket URL: <https://code.djangoproject.com/ticket/35322#comment:1>

Django

unread,
Mar 21, 2024, 11:22:52 AM3/21/24
to django-...@googlegroups.com
#35322: Slow feedback loop in tests using Postgres
-------------------------------+--------------------------------------
Reporter: Martin Lehoux | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 5.0
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Comment (by Martin Lehoux):

Ok thanks, sorry for the annoyance!
--
Ticket URL: <https://code.djangoproject.com/ticket/35322#comment:2>
Reply all
Reply to author
Forward
0 new messages