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

stop the interaction of hypothesis and disttrial from hanging the tests #571

Merged
merged 4 commits into from
Apr 29, 2023

Conversation

glyph
Copy link
Member

@glyph glyph commented Mar 31, 2023

something that disttrial is doing is making it so that a threading.local() reference being kept by a recursive hypothesis strategy (but only if it is actually recursive!) retained at module scope getting torn down during interpreter finalization prevents both workertrial and the parent disttrial processes from exiting, hanging forever

@glyph glyph requested a review from a team as a code owner March 31, 2023 00:44
@glyph glyph marked this pull request as draft March 31, 2023 00:44
@glyph
Copy link
Member Author

glyph commented Apr 28, 2023

see also python/cpython#28525

@codecov
Copy link

codecov bot commented Apr 28, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (76a2db0) 99.04% compared to head (91a5d73) 99.04%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #571   +/-   ##
=======================================
  Coverage   99.04%   99.04%           
=======================================
  Files          44       44           
  Lines        3883     3887    +4     
  Branches      519      520    +1     
=======================================
+ Hits         3846     3850    +4     
  Misses         23       23           
  Partials       14       14           
Impacted Files Coverage Δ
src/klein/test/test_plating.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@glyph glyph marked this pull request as ready for review April 28, 2023 21:29
Copy link
Member

@adiroiban adiroiban left a comment

Choose a reason for hiding this comment

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

Hi.
I have close to zero experience with hypothesis.

But I guess the changes are fine and this can be merged.

Thanks!

@twm twm merged commit f37253a into master Apr 29, 2023
@twm twm deleted the odd-teardown branch April 29, 2023 03:56
@exarkun
Copy link
Member

exarkun commented May 1, 2023

Another reference - HypothesisWorks/hypothesis#3585

@glyph
Copy link
Member Author

glyph commented May 2, 2023

@exarkun does that reference tell us when we can remove this gross hack? :)

@exarkun
Copy link
Member

exarkun commented May 2, 2023

@exarkun does that reference tell us when we can remove this gross hack? :)

This comment seems to suggest the fix will be in the next bugfix release of Python 3.11 and the next major release. There is also an upstream bug report which is closed now (and seems like a duplicate of the cpython bug report linked here, above).

@glyph
Copy link
Member Author

glyph commented May 3, 2023

@exarkun does that reference tell us when we can remove this gross hack? :)

This comment seems to suggest the fix will be in the next bugfix release of Python 3.11 and the next major release. There is also an upstream bug report which is closed now (and seems like a duplicate of the cpython bug report linked here, above).

Thanks for those references!

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.

4 participants