-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Multithreaded testing #732
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
Conversation
|
Changes Unknown when pulling 2b4de32 on wiredfool:multithreaded_testing into * on python-pillow:master*. |
|
Good stuff, shaved off a good 4-5 minutes from the build too: from about 90s to 30s per test run. But coverage reporting is broken, it's really higher than 34%: we'll need have separate coverage data files and then combine at the end. |
|
From http://nose.readthedocs.org/en/latest/doc_tests/test_multiprocess/multiprocess.html:
So, it's either fast tests or working coverage for now, until the upstreams fix it. Or... http://nedbatchelder.com/code/coverage/cmd.html
https://bitbucket.org/memedough/nose-cov/overview
|
|
Well, that didn't do it. |
|
Working coverage is more useful than faster tests. It may be worth asking Ned Batchelder directly for tips. |
|
Well, that appears to have fixed the coverage generation on travis, it's reporting 71%, not so sure about coveralls reporting, which is reporting a grey box. |
|
@hugovk Any ideas on what's wrong here? |
|
@wiredfool Not really. Clearly Coveralls isn't processing the combined build report properly, or isn't being sent it properly. It looks like we're combining properly, as This is the third-party |
|
I'm checking this locally, and it's consistent at least. There's nothing obviously wrong that I can see. |
|
Coveralls hates me: #748 (comment) #749 (comment) (Both of these are Changes Unknown, but with a reasonable percentage) |
This is the update to the other half of the multithreading PR.
Tempfiles are now created using tempfile.mkstmp, the secure, unaffected by race conditions api, rather than manually creating a well known directory and adding possibly unique names in it. The tempfiles are cleaned up after each individual successful test. If not successful, then the test file is reported as remaining at that time. This allows tests to be more independent, reorderable, and not have any global state that needs cleaned up at the end of a run.
This removes tearDownModule, as it is run each time a module changes, which could be as frequently as every test. Global state in the teardown function is very difficult to handle when using multiple test runners.
FWIW, this appears to improve the testing time from ~1:20 to ~30 seconds wall time for the testing phase on travis.