On May 4, 2:30 pm, Karen Tracey <[email protected]> wrote: > On Fri, May 4, 2012 at 4:46 AM, Andreas Pelme <[email protected]> wrote: > > > That's a good question. Anyone who wrote to original > > TransactionTestCase/reordering implementation that wants to chime in? :-) > > I worked on the test speedups that introduced TransactionTestCase and > I added the re-ordering, but the behavior of database flush being done > at the beginning of a test existed before that work. The conversation > that led to addition of the reordering is here: > > http://groups.google.com/group/django-developers/browse_thread/thread... > > doctests (which we have no more?) play a prominent role in that > discussion. While we have gotten rid of doctests in Django's own > suite, we still support apps which may use doctests in their code, so > anything we do to change when the DB is cleared needs to take that > into account. On the table then was the idea of adding cleanup after > doctests, possibly that would need to be re-considered if you want to > move the database clearing to the end of everything rather than the > beginning of TransactionTestCase.
Thanks for the link. While reading the previous threads I spotted at one blocker issue: the first TransactionTestCase will not start with zeroed database sequence values. To prevent this one would need to flush the DB before the first TransactionTestCase. In addition, if the goal is to get rid of test ordering, then one would need to flush before every test case which isn't good. Getting rid of the requirement to reset sequences between test cases would be good. Oracle doesn't reset the sequences reliably currently just for example. But I don't think we can change that for backwards compatibility reasons. While tests that rely on sequence values are IMHO broken, changing this would result in numerous broken tests for users upgrading Django. Notably normal TestCases do not do sequence resetting at all currently. This is a blocker: why change the flushing from pre-test to post-test if the end result is that you can't run the tests in arbitrary order anyways? Or if you want to be able to run them in arbitrary order you will need to run at least the sequence resets pre-test anyways. Resetting sequences can be really expensive, so there goes any potential savings in speed. Ideas? - Anssi -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
