-
Notifications
You must be signed in to change notification settings - Fork 595
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
coverage feature increases test runtime by factor 3 #879
Comments
Ugh. Sorry that it's been that big of a slow down. I knew this could cause performance regressions on some workloads, but 3x was a lot more than I expected!
Hypothesis currently doesn't take the coveragerc into account. It's something of a deliberate choice that it does this - coverage information from the code you call is actually pretty good for finding interesting behaviours - but good point that I hadn't taken that factor into account when writing the line about performance, sorry! One thing to confirm is that you are running with the coverage C extension. It seems unlikely that you wouldn't be, but worth checking. If you run Anyway, performance of this mode is definitely something I'll be working on in the near to medium-term future. One of the likely changes is that I'm going to lower the default |
With any luck, once #880 has been merged you should see default performance go back to roughly on par with what you had before - it implements the change of the default |
Thanks for looking into this!
It's software. Something is always not going to go the way one expects. Don't worry or stress yourself out over this.
I will give it a shot and report back. We pinned hypothesis to |
I ran the command as requested:
[tox]
skipsdist = True
envlist = hypothesis
[testenv]
basepython = python3.5
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements-test.txt
commands = python -c 'from coverage.tracer import CTracer ; print(CTracer)'
machine:
python:
version: 3.5.3
test:
override:
- tox --recreate Output for hypothesis 3.28.3
Output for hypothesis 3.30.0:
|
OK. You should see at least a factor of two improvement by updating to Hypothesis 3.30.4 (because it halves the number of examples...), hopefully but not definitely more. To get the rest of the way and then some, I'm going to be addressing performance problems on the coverage side (funding for which would be extremely welcome if you felt so inclined 😉). I'll leave this ticket open for now to track the impact on the Hypothesis side of things, but it probably won't see much change outside of coverage. |
Hi,
The 3.29.0 release added support to use coverage for its example optimization. According to the release notes, "Tests that are already running Hypothesis under coverage will likely get faster.".
We were and are running this command from within a tox environment, testing a Django project:
When updating to hypothesis >=3.29.0 our test runtime increases from around 10 minutes to 35 minutes. We did not set the
use_coverage
flag and don't have any other hypothesis settings.The culprit seems to be / could be that coverage all the sudden starts collecting stats for files in the .tox environment as well as in
/opt/
(we're running on CircleCI), not just in the application code. Here's the[run]
section from the.coveragerc
file:I'm happy to give further details, just not sure what's helpful right now.
The text was updated successfully, but these errors were encountered: