FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-86275: improve Hypothesis configuration for CI and local runs by Zac-HD · Pull Request #104468 · python/cpython · GitHub

/ cpython Public

gh-86275: improve Hypothesis configuration for CI and local runs - #104468

Merged
hugovk merged 4 commits into
python:mainfrom
Zac-HD:hypothesis-configuration
May 21, 2023
Merged

gh-86275: improve Hypothesis configuration for CI and local runs#104468
hugovk merged 4 commits into
python:mainfrom
Zac-HD:hypothesis-configuration

Conversation

Zac-HD commented May 14, 2023
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

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

  1. Unfortunately the 'dump a patch with explicit examples' workflow relies on libcst and our pytest plugin - if this would be particularly interesting we can talk about making it work with unittest and perhaps even ast.

AlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Comment thread .github/workflows/build.yml Outdated

Zac-HD commented May 16, 2023

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again.

Copy link
Copy Markdown

Thanks for making the requested changes!

@AlexWaygood: please review the changes made to this pull request.

bedevere-bot requested a review from AlexWaygood May 16, 2023 02:20
AlexWaygood dismissed their stale review May 16, 2023 07:13

It's valid syntax now

Zac-HD requested a review from hugovk May 17, 2023 20:31
Zac-HD force-pushed the hypothesis-configuration branch from 6476ee0 to ccbb010 Compare May 20, 2023 19:30
hugovk merged commit 014dd30 into python:main May 21, 2023
Zac-HD deleted the hypothesis-configuration branch May 21, 2023 13:02
key: hypothesis-database-${{ github.head_ref || github.run_id }}
restore-keys:
restore-keys: |
- hypothesis-database-

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@Zac-HD did you mean to keep that leading hyphen?

webknjaz Jul 14, 2024
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This makes it look up the '- hypothesis-database-' prefix, and I'm pretty sure you wanted 'hypothesis-database-':

Cache not found for input keys: hypothesis-database-9927179210, - hypothesis-database-

(https://github.com/python/cpython/actions/runs/9927179210/job/27421821417#step:21:24)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@Zac-HD here's the fix: #121756

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL