Skip to content

chore(deps): update dependency hypothesis to v6 #3512

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 26, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
hypothesis (changelog) 4.24.6 -> 6.133.2 age adoption passing confidence

Configuration

📅 Schedule: Branch creation - "every weekend" in timezone US/Eastern, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/hypothesis-6.x branch 17 times, most recently from a3ed958 to 79a9343 Compare June 2, 2025 09:20
@renovate renovate bot force-pushed the renovate/hypothesis-6.x branch from 79a9343 to 975efe2 Compare June 2, 2025 10:26
@asajjad2 asajjad2 self-assigned this Jun 2, 2025
@renovate renovate bot force-pushed the renovate/hypothesis-6.x branch 3 times, most recently from d1109b0 to 23449e5 Compare June 3, 2025 03:19
@asajjad2 asajjad2 force-pushed the renovate/hypothesis-6.x branch from 23449e5 to c9b1183 Compare June 3, 2025 10:49
Copy link
Contributor Author

renovate bot commented Jun 3, 2025

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

@asajjad2
Copy link
Contributor

asajjad2 commented Jun 3, 2025

In this upgrade, the tests began failing in CI with the error:

hypothesis.errors.InvalidArgument: Expected settings but got settings=<bound method SimpleTestCase.settings of <authentication.views_test.AuthStateTestCase testMethod=runTest>> (type=method)

The main problem here seems to be the name collision between Django's TestCase.settings method and Hypothesis settings object. Our test class inherits from both Django's HTestCase and Hypothesis's AuthStateMachine.TestCase. The auto-generated runTest method from Hypothesis calls:

run_state_machine_as_test(cls, settings=self.settings)

self.settings was resolving to Django's settings method instead of Hypothesis settings object.

This was previously being ignored but arises now probably because hypothesis 6.116.0+ introduced stricter CI type checking. Also note the error doesn't arise when the tests are run locally.

To fix this, I changed the inheritance order so Python finds Hypothesis's settings first instead of Django's. This fixed the type mismatch. From what I understand, now that the settings collision is resolved, Hypothesis can actually run the state machine test properly. But it discovered a problem with our test design, throwing

InvalidDefinition: No progress can be made from state 

Some of our test flows are "dead ends" - they start a user journey but don't lead anywhere. Specifically, when a user tries to login with an email that doesn't exist login_email_not_exists(), our test just stops there instead of continuing to registration or some other logical next step.

@asajjad2
Copy link
Contributor

After fixing the Hypothesis settings collision, I've been addressing individual dead-end rules one by one (login_email_not_exists, login_password_exports_temporary_error, login_password_valid, now login_password_user_inactive), but each fix just reveals another rule with the same pattern - they consume bundles but don't produce any, causing No progress can be made from state errors. This suggests a systematic design issue rather than individual rule problems. Our auth state machine has many naturally terminal conditions (successful login, errors, edge cases) but Hypothesis expects continuous flow through bundle production or flow resets.
The whack-a-mole approach isn't working - we need either to either reduce max_example and stateful_step_count to reduce test complexity or add proper bundle flows for all terminal states, a complete top-down redesign that matches real user journey patterns.

TLDR: The fundamental issue is our bundle/flow design doesn't align with the natural terminal nature of authentication flows.

@asajjad2 asajjad2 removed their assignment Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant