-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
parallelize_tests #1951
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
parallelize_tests #1951
Conversation
Does anyone have any thoughts about the test failures? I'm stumped, and I can't reproduce them on a Ubuntu Precise VM I have (which apparently matches what Travis has). |
Why is the testing/util.py file deleted? |
|
I can't see travis-ci test results anymore (this has been true for some time now) - my browser crashes and burns when it sees the long log (firefox 17.0.5). It renders the travis-ci system into a pretty useless binary pass/fail system for me. Can we look at making the logs shorter again? (I have a "print if fails" executable in cartopy to hide the build output unless it went wrong, for example: https://travis-ci.org/SciTools/cartopy/builds/6686231). I can't see beyond the build output as it stands. |
In principle this looks good. I'm guessing you're adding the necessary multiprocess arguments to your I also can't see what has changed that would make travis-ci use multiprocessing - I would have expected an update to |
@pelson: I haven't had any trouble getting the logs from Travis lately. They recently did make the log fetching more chunked which has helped a lot. But I could capitulate and hide setup parts of the log if there's no other way. In any event, for this specific PR, you can get the raw log here: https://s3.amazonaws.com/archive.travis-ci.org/jobs/6665520/log.txt As for how to run this with multiprocess -- I had originally added |
Ok -- I've got this mostly working. The initial failures were due to still importing It still seems, however, that running the tests in parallel on Travis doesn't work:
I'm perfectly fine with merging this as is, because it's still very useful for running tests locally. I'm not entirely sure that Travis would give us access to more than one core per VM anyway -- I find the Travis docs completely unwieldy, so I can't confirm or deny that, but I wouldn't be surprised. |
FWIW you can get at the log output in the form: https://api.travis-ci.org/jobs/{build_id}/log.txt?deansi=true I was able to reproduce the freezing that travis-ci saw - it was related to providing a negative value to the processes argument so instead I went for the less elegant After fixing that, I was able to get the tests to run in ~91 seconds with just 3 failiures: https://api.travis-ci.org/jobs/6781057/log.txt?deansi=true . I think it might be worth tracking these down (if its not too thorny). (my extra commits were in my copy of your branch https://github.com/pelson/matplotlib/tree/multiprocess_testing) |
@pelson: Thanks for getting to the bottom of the hanging. nosetests uses In any case, I think your solution is just fine. I think it also makes sense to log the value of |
Ok -- it seems we're down to one failure: test_bbox_inches_tight_suptile_legend. The image is a different size than expected. |
With the latest commit (which should not have affected I wonder if the |
…ry to create a directory at the same time
…nkscape on Travis
…t of memory when running too many inkscapes/ghostscripts in parallel
I think I finally have something that works on Travis (excepting the usual Travis network errors). Any volunteers to do a little more local testing before merging? |
Sure, I'll give it a spin. |
Uhm, I am getting an import error saying that pyparsing >= 1.5.6 is |
@WeatherGod: Is the import error on building, or importing once installed? Are you certain you're in the same virtualenv/version of Python where you have pyparsing installed? |
@WeatherGod: also -- how are you running the tests? If from |
It is an error on import. See the following output (where I am using a
|
Odd indeed. Here's a wild guess: do you have a |
Oh, wow, I didn't think of that. I didn't think to check the egg As a side note, I notice that setup.py now does a download, if needed, |
- python setup.py install | ||
|
||
script: | ||
- mkdir ../tmp_test_dir | ||
- cd ../tmp_test_dir | ||
- python ../matplotlib/tests.py -sv | ||
- echo Testing using 4 processes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The echo statement here doesn't match what is passed to the command line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. Thanks for catching.
@WeatherGod: since setuptools is doing the downloading, my understanding is that it's ok, since the Debian build environment will cause the downloading not to happen. They basically have a generic way to handle all setuptools-based builds. |
So, even with two processes and 4GB of RAM, I am running into issues where the processes run such high memory usages (~3GB each) that my system starts to swapping like crazy. And it seems like it isn't making any further progress even though my processors keep getting pegged (whenever an io wait is finished, that is). I can do a simple matplotlib.test() run with no problems, so I don't know why doing it with two processes is much, much worse. |
@WeatherGod: Thanks. That's a useful data point. I'm not sure what further to investigate. For me, on Fedora 18 (which shouldn't be fundamentally different from your CentOS box), with 4GB and 4 cores, I'm not seeing runaway memory usage. This is also on Python 2.7. What do you get for:
|
[centos6] [broot@rd22 ~]$ gs --version I can do tests tonight on a Ubuntu 12.04 machine that is quite a bit |
So, on my Ubuntu 12.04 machine, setting it to 2 processes, it just hangs immediately after completing the first test. But, if I run it in single process mode, it works just fine.
|
Ok. Interesting -- I guess this is farther from ready than I thought. The Travis tests are running in a Ubuntu 12.04 VM, if I recall correctly, so I'm surprised it works there and not for you. We did see hanging initially when trying to use @pelson: Have you tried running the tests locally, or only on Travis? |
I'm still unable to reproduce @WeatherGod's issue (I tried on a clean Ubuntu 12.04 VM). Very strange. How do we all feel about this PR? Personally, I'd love to have it in (since it works for me -- sorry to be selfish), and it shouldn't be any worse for anyone not running the tests in parallel. Travis seems to like running the tests in parallel as well, so I'm leaning toward turning it on in |
On Wed, May 15, 2013 at 3:00 PM, Michael Droettboom <
|
After installing matplotlib, from a temporary directory, I run:
|
This is absolutely fine to be merged. I too have memory problems (Intel® Xeon® Processor E5520 with 8 threads and 5.7Gb addressable RAM on RHEL6 64bit, Python 2.7) which mean I cannot run the tests in parallel (even with |
For the record, running with the
|
Come to think of it, I too also ran my commands with the -sv option. |
For the record, I don't think it is because you're running it with sv - I just did that to see if I could see where it stalls (I'm not sure if you can though...) |
Ok -- it definitely sucks that it's failing for an unknown reason for (at least) @pelson, and @WeatherGod, but I think I'll merge this so we at least get the benefits for Travis as we head into the release period, and then I'll open a new issue for getting to the bottom of the failures. |
This is a possible solution to #1508 to get the test suite running in parallel.
The main fix was to not use a single gs process to do the conversion but to instantiate it every time. This makes parallelizing much easier, and it was never much of an optimization anyway. (Alternately, we could use one
gs
process if not parallelized, but I couldn't figure out how to detect in nose which mode we were in).There was also a bug where the mathtext tests were being generated with different function names than what they were called in the module's namespace, which broke pickling of those functions through multiprocessing.
On my 4 core i7 machine, the wall clock time was 10:32, now it is 3:05 running all 4 cores. Pretty nice!
This also adds more tests to the default suite run by Travis.