-
Notifications
You must be signed in to change notification settings - Fork 530
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
TEST: Parallelize pytest #2469
TEST: Parallelize pytest #2469
Conversation
On my experience those two cores will perform as just one.... |
Well, looks like we're dropping from 6:30 to about 4:15, so about a 33% speedup, which isn't too bad for 2 cores. |
I think also, one of the reason why I didn't remove imports etc. from files to auto-fixture was that i thought it will be harder for users to follow these examples. Not sure, how important it is.. |
Yeah, I get one failure, but I'm not sure if that's related. I've never tried testing that way. I'll check on master.
Doesn't seem super useful to me, since those docstrings are never rendered in the published docs. But I'm okay being overruled here. |
the docstrings are meant to guide individuals - they are not meant to execute a real computation. so i'm +1 for fixture as long as it doesn't get in the way of the docstrings (which at least in this PR it doesn't look like). |
@effigies - i also don't usually test like that, but @satra always wanted to include this option, so users can easily test regarding docstrings, I just wanted explain my point, I thought that they should be design in a way that users can search the file, copy-paste and try to execute |
Okay, the failure introduced by this in nipype/nipype/pipeline/plugins/tests/test_callback.py Lines 49 to 67 in 6ca791d
The failing line is:
Don't see what should be affecting it, immediately. |
@effigies sorry, I think this time it's not related to directory structure, you didn't change anything with it, but doesn't like the flag |
@satra ok |
(almost) all tests are passing on my OSX when I removed
|
Oh, I see. We were overwriting some of what was in the The 3.4 and 3.5 issue that's showing up on Travis is that dictionaries don't have guaranteed order pre-3.6. See pytest-dev/pytest#1075. Someone there suggests adding |
Dictionaries in Python < 3.6 are not ordered by insertion
Went ahead and used |
Was curious how much parallelizing could squeeze down pytest runtime, acknowledging that it's already not super long (~10 minutes out of a 40 minute build and test cycle).
This led down a doctest-shaped rabbit hole, because some workers were running the module-level doctests that changed directories and others were running the function-level doctests, and the context wasn't being shared so there were a couple stochastic crashes each build. So I figured out how to set a fixture that would
chdir
into thetesting/data
directory on doctests and only doctests. This seems cleaner than the old way of doing it anyway.Changes proposed in this pull request
pytest-xdist
to testing dependencies-n auto
to pytest configin_testing
fixture tochdir
for doctestschdir
boilerplate