Hey there,

I'm making some progress on the app loading gsoc project. I'm still in the 
process of writing tests for the AppCache. It took me longer than I've thought. 
However, I'm really confident that I'll finish the testing stuff this week and 
move on to writing the new App class. There are still some things that I don't 
understand. I've written them down below, and would really appreciate it if 
someone could take a look at them.

1. The AppCache is initialized early when the test cases are run, which means 
that not everything can be tested properly. I'm currently using a standalone 
script, but it would be better if Django's test runner could run the tests 
without initialized the AppCache. Are there already plans to change this (maybe 
in the testing improvement gsoc project?)

2. Some methods are using a lock in order to be thread-safe[0]. I haven't found 
a good way to test this nor can I reproduce the threading problems when 
removing the locks. Is there a good way in Python to test concurrency problems? 
(should such problems even be tested at all?)

3. Changeset 5919[1] modified the AppCache class to use the Borg/Monostate 
pattern. However, I haven't found a single case where there is more than one 
instance created. Does someone know a case?

4. Also in the same changeset, the 'nesting_level' and 'can_postpone' variables 
were introduced. These fixed a problem where the package is still being 
imported by Python and the model module isn't available yet. Again, I couldn't 
reproduce this problem. As Malcolm Tredinnick notes in the comments to Ticket 
1796 [3], writing a test case for this is difficult as the problem is dependent 
on hardware/OS/etc. Has anyone here run into similar problems or can reliably 
reproduce the error? (and is there any way to contact Malcolm?)

5. The app_errors attribute/the get_app_errors method doesn't seem to be used 
at all. Is there a reason why it's still there?

Arthur

[0]: 
http://code.djangoproject.com/browser/django/trunk/django/db/models/loading.py#L124
[1]: http://code.djangoproject.com/changeset/5919
[2]: http://code.djangoproject.com/ticket/1796#comment:65


-- 
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.

Reply via email to