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

Test issue with hypothesis>=6.0.4 and python>=3.10 #45

Closed
handrews opened this issue Feb 17, 2023 · 1 comment · Fixed by #49
Closed

Test issue with hypothesis>=6.0.4 and python>=3.10 #45

handrews opened this issue Feb 17, 2023 · 1 comment · Fixed by #49

Comments

@handrews
Copy link
Contributor

While testing a planned PR submission I noticed that while everything runs fine on Python 3.8 and 3.9, on 3.10 the tests complete successfully but hang without proceeding to the coverage report. Running pytest alone from the same virtualenv also hangs.

I eventually tracked this down the use of hs.recursive() in jschon.tests.strategies, and determined that hypothesis 6.0.3 and earlier are fine, but 6.0.4 or later introduce the hang. The changelog for 6.0.4 shows that its only change attempted to fix a race condition in recursive() (issue HypothesisWorks/hypothesis#2717, PR HypothesisWorks/hypothesis#2783).

The fix has to do with multiple threads, and if there are multiple threads involved here then I'm a bit out of my depth- I haven't used threads in Python in over a decade, if ever (I honestly can't recall). If threads are not involved, it's not clear to me what the problem is. Google has not been helpful so far.

I'm filing this here to record the investigation so far and in hopes that maybe @marksparkza might know where to go next. I have not tried to figure out if there are calls to recursive() that work, I just know that if you comment the calls out of jschon.tests.strategies then things don't hang. Otherwise, importing the module causes a hang whether the test uses anything from it or not.

The problem also seems to happen on Python 3.11 although I have not investigated that in detail.

Restricting hypothesis<6.0.4 in tox.ini lets the tests path on all releases of Python (including 3.11).

@handrews
Copy link
Contributor Author

I narrowed this down and filed csernazs/pytest-httpserver#217 and HypothesisWorks/hypothesis#3585 as the problem appears to be with one or the other project. It's probably worth pinning hypothesis to 6.0.4 until this gets fixed, so I'll submit a PR for that.

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 a pull request may close this issue.

1 participant