gh-86275: improve Hypothesis configuration for CI and local runs#104468
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per #22863 (comment), this PR configures Hypothesis to ignore unexpectedly slow tests. Relative to the default of failing, this reduces flakiness due to variable performance of CI machines.
The second commit adds caching to the CI test run, so that if a CI run finds a rare but real failure that input will be replayed in future CI runs (at least until the cache expires, or the test passes and Hypothesis discards the now-passing input). This doesn't come up often, but if it does will convert flaky tests into reliable failures.
Third, we can upload the database as an "artifact" from CI and configure local runs to use that as a pull-through cache - meaning that "reproducing a failure from CI" is just "run the tests locally". No impact on flakiness but it's a rather nice workflow! 1
cc @pganssle for review / checking that it works on your machine
Footnotes
Unfortunately the 'dump a patch with explicit examples' workflow relies on
libcstand our pytest plugin - if this would be particularly interesting we can talk about making it work withunittestand perhaps evenast. ↩