-
-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
manage.py --parallel
flag has no effect under django-nose
#276
Comments
Good question. I have not used this option myself, so I'm not sure how it is supposed to work. There may be additional options needed to tell http://nose.readthedocs.io/en/latest/usage.html?highlight=processes#cmdoption--processes You may also need to look carefully at your test setup, to see if you can mark fixtures and test classes as being available for multiprocess testing: http://nose.readthedocs.io/en/latest/doc_tests/test_multiprocess/multiprocess.html |
I had previously tried the
This looks suspiciously like a Rails mysql parallelization issue here: http://stackoverflow.com/questions/5269876/activerecordstatementinvalid-mysqlerror-mysql-server-has-gone-away-using I.e. the Mysql driver might not be naively parallelizable, and we need to wait until after forking to establish DB connections. (I could believe this is the magic implemented in the django Setting |
Was this with both? Like |
Same result both with |
This appears to be affection Django 1.9 but not Django 1.10:
|
I get the same results on django 1.10 as on 1.9:
Note the test durations are the same. |
@paultiplady I stand corrected, thank you :)
|
+1 I'm hitting the same issue as well. Any one have any luck with fixing this? |
After adding up configuration, fixing some tests to make it completely work in nose, I found running test is taking 2x time than django's default runner, and that's when I found this issue :( I think this issue must be mentioned in the docs. Anyway, I'm not here just to whine. I spent some time to figure out the reason. So, this issue won't have any workaround other than proper fix in the django-nose code. We can't use I don't have time to fix it up, I'll probably be switching back to django's default runner. Here's some implementation detail in case anyone wants to fix it up: The way django's default runner handles this problem is, it partitions the whole testsuite into sub-suites[0] and abstract those multiple suites by subclassing To fix this issue in django-nose, the key idea is one will have to do similar stuff of creating multiple processes here[4], run all the sub-suites, keep accumulating results and return it. |
FWIW I'm using I found that The main complaint I have about pytest is that you still need to use Django's |
FWIW it is working for me now. I am using Just
|
Django 1.9 introduced the
--parallel
flag, to run tests in parallel. This gives a 4x speedup on my 4-core Macbook Pro under the default unittest runner, which is pretty great.Unfortunately I get no effect when I use this flag with the nose test runner.
It does look like the setup is being performed:
But the test duration is no better than without the
--parallel
flag.Is this flag expected to work? I don't see any documentation for it, though it is explicitly passed through to manage.py here https://github.com/django-nose/django-nose/blob/3b9dad77d0440cace471aa43d77a4ba619f145bb/django_nose/runner.py#L91
The text was updated successfully, but these errors were encountered: