Opened 9 years ago

Closed 8 years ago

#4998 closed (fixed)

Database activity makes test cases very slow

Reported by: russellm Owned by: nobody
Component: Testing framework Version: master
Severity: Keywords:
Cc: remco@…, egmanoj@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


The level of database activity required by the test system renders the testing process painfully slow. This is especially bad with django.test.TestCase - resets are very expensive operations, which can significantly slow down the testing process (to impractical speeds).

Change History (7)

comment:1 Changed 9 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 9 years ago by Simon G. <dev@…>

comment:3 Changed 9 years ago by Nis Jørgensen <nis@…>

Just out of curiosity: In my experience, this is a big problem with postgresql, and almost no problem with sqlite (which runs in-memory for tests). How slow are things in the other backends?

comment:4 Changed 9 years ago by anonymous

  • Cc remco@… added

comment:5 Changed 9 years ago by Manoj Govindan <egmanoj@…>

  • Cc egmanoj@… added

comment:6 Changed 8 years ago by simon

This relates to #8138 which proposes running tests in transactions to speed up the database reset operation.

comment:7 Changed 8 years ago by kmtracey

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

I'm going to call this fixed by r9756/#8138. There is perhaps more to do with speeding things up, but the specific item called out in the initial description here, that is the slowness of django.test.TestCase, was fixed in r9756.

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