-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
PERF: Test suite #51520
Comments
HEY, i am new. can u guide me for doing this please. i want to do this |
Welcome @harsimran44! We suggest that newcomers look for issues with the "good first issue" label. |
This is an issue in groupby as well, especially for some tests I've added or directed others to add. The issue is that there are so many combinations:
A good example demonstrating this is |
Another example is One thing I've been wondering is if in this case (and others like it) that we should replace "all possible sequences" with a randomly chosen sequence or small (5?) set of sequences. This would be better for performance, but would also possibly introduce a flaky test. With |
I don't think having large parameterized test in itself is a bad thing, but I suspect those test possibly render other (older) tests redundant.
IMO I dislike randomly generated data in tests for the flakiness you mention; it makes PR review a pain. I would rather be thorough or use hypothesis in these cases. |
I'm of mixed mind on randomly generated test data, but trending an an "anti" direction. For tz_(naive|aware)_fixture in particular, we could in principle use all of pytz.all_timezones (596 entries locally) and presumably multiply that by 3 to include dateutil/zoneinfo counterparts. And arbitrarily many fixed offsets. Clearly we're not going to add all of those to the fixtures. A few years back I toyed with the idea of using a randomized subset. At this point I could be convinced, but don't see enough value here to pursue it myself. One place where I've poked at generating randomized data is generating "any" Index (possibly for use in tests.indexes.test_any_index). I think there are a lot of corner cases we likely miss in the status quo (increasing, decreasing, non-monotonic, mixed-Xs-and-Ys, values near implementation bounds, int64 values near float64 rounding bounds, infs, ...). It's been a while since I looked at this. IIRC I tried implementing something with hypothesis and found a) enumerating all the cases I wanted was tough, b) the runtime would be really rough, c) there are relatively few tests where we want genuinely any index as opposed to "any datetime index", "any datetimeIndex with a freq", ... and enumerating all of those any_foos would be annoying. |
Closing as "no action" |
The runtime of the test suite has roughly doubled in the past year. A lot of this reflects new features (pyarrow dtypes, non-nanosecond dt64/td64) or just improved test coverage, so this isn't a bad thing. But it is a pain point for my workflow and I expect not a coincidence that we see so many CI timeouts (xref #51409).
Some observations:
pytest -n=many
doesn't go very far unless you've got loads of memory.* Some reported timings are with --profile enabled, which can throw off the big-picture numbers. Take grains of salt where appropriate.
cc @mroeschke @phofl
The text was updated successfully, but these errors were encountered: