gh-86275: improve Hypothesis configuration for CI and local runs#104468
Conversation
AlexWaygood
left a comment
There was a problem hiding this comment.
The CI on this PR is currently failing to start due to invalid workflow syntax:
https://github.com/python/cpython/actions/runs/4977097067
The workflow is not valid. .github/workflows/build.yml (Line: 378, Col: 11): A sequence was not expected
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
|
I have made the requested changes; please review again. |
Sorry, something went wrong.
|
Thanks for making the requested changes! @AlexWaygood: please review the changes made to this pull request. |
Sorry, something went wrong.
6476ee0 to
ccbb010
Compare
May 20, 2023 19:30
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. ↩