You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
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.
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()
injschon.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 inrecursive()
(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 ofjschon.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
intox.ini
lets the tests path on all releases of Python (including 3.11).The text was updated successfully, but these errors were encountered: