Skip to content
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

Reuse up to max_examples examples when generation is disabled #2585

Closed
Zac-HD opened this issue Sep 4, 2020 · 2 comments · Fixed by #2601
Closed

Reuse up to max_examples examples when generation is disabled #2585

Zac-HD opened this issue Sep 4, 2020 · 2 comments · Fixed by #2601
Labels
internals Stuff that only Hypothesis devs should ever see

Comments

@Zac-HD
Copy link
Member

Zac-HD commented Sep 4, 2020

desired_size = max(2, ceil(0.1 * self.settings.max_examples))

No matter how many examples are in the database, we'll use at most 10% of our example budget replaying them - even if the generation phase is disabled. It would be nice if we could replay up to max_examples when Phase.generate not in self.settings.phases.

@Zac-HD Zac-HD added the internals Stuff that only Hypothesis devs should ever see label Sep 4, 2020
@oxfordhalfblood
Copy link

@Zac-HD I'm interested to take a look at this.

@Zac-HD
Copy link
Member Author

Zac-HD commented Sep 6, 2020

Hi @oxfordhalfblood! https://hypothesis.readthedocs.io/en/latest/settings.html#phases explains how phases work in Hypothesis.

While a run with default settings will reuse (up to) 10 examples and then generate 90 examples, if we've disabled the generate phase Hypothesis should reuse max_examples=100 examples from the database instead. So the calculation for desired_size should multiply by (0.1 if Phase.generate in self.settings.phases else 1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internals Stuff that only Hypothesis devs should ever see
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants