Opened 2 years ago

Closed 2 years ago

#20603 closed Cleanup/optimization (fixed)

Make the test suite even faster with available apps

Reported by: aaugustin Owned by: nobody
Component: Testing framework Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


There's a few TestCases that run call_command('syncdb', ...). They would be much faster with a suitable value of available_apps.

As usual the idea is from Anssi:

Change History (2)

comment:1 Changed 2 years ago by aaugustin

The following hack helps locate culprits:

diff --git a/django/core/management/ b/django/core/management/
index b58d89f..eeeb483 100644
--- a/django/core/management/
+++ b/django/core/management/
@@ -207,6 +207,8 @@ def emit_pre_sync_signal(create_models, verbosity, interactive, db):
 def emit_post_sync_signal(created_models, verbosity, interactive, db):
     # Emit the post_sync signal for every application.
+    print("post-syncdb on %d apps" % len(models.get_apps()))
+    import pdb; pdb.set_trace()
     for app in models.get_apps():
         app_name = app.__name__.split('.')[-2]
         if verbosity >= 2:

(Type bt whenever you enter pdb to check which test is running, then c to resume the tests.)

Version 1, edited 2 years ago by aaugustin (previous) (next) (diff)

comment:2 Changed 2 years ago by Aymeric Augustin <aymeric.augustin@…>

  • Resolution set to fixed
  • Status changed from new to closed

In c3df86661955f218de4788a57338bb23428f5525:

Fixed #20603 -- Made the test suite faster.

By avoiding to run syncdb with the full set of test models.

Thanks Anssi for the idea.

Note: See TracTickets for help on using tickets.
Back to Top